summaryrefslogtreecommitdiffstats
path: root/lib/yang_wrappers.h
diff options
context:
space:
mode:
authorRafael Zalamena <rzalamena@opensourcerouting.org>2019-10-12 01:15:46 +0200
committerRafael Zalamena <rzalamena@opensourcerouting.org>2019-10-12 03:41:17 +0200
commit46fcb2df90409e401223d29c6162753bf73fca64 (patch)
tree324c50ed09846248ec67f723c15a1100222c9a1d /lib/yang_wrappers.h
parentbfdd: don't allow link-local without interface (diff)
downloadfrr-46fcb2df90409e401223d29c6162753bf73fca64.tar.xz
frr-46fcb2df90409e401223d29c6162753bf73fca64.zip
lib: use `prefix` for yang get prefix wrapper
This change fixes a static analyzer warning and should also make us safer when using this function. At the moment the code that triggered the warning is the only one that uses this function. Passing anything other than `struct prefix` to `str2prefix` function is dangerous, because the structure might be smaller than expected and we might have an buffer overflow. Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
Diffstat (limited to '')
-rw-r--r--lib/yang_wrappers.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/yang_wrappers.h b/lib/yang_wrappers.h
index 1a30ff368..10d1ea314 100644
--- a/lib/yang_wrappers.h
+++ b/lib/yang_wrappers.h
@@ -118,7 +118,7 @@ extern void yang_get_default_string_buf(char *buf, size_t size,
extern void yang_str2prefix(const char *value, union prefixptr prefix);
extern struct yang_data *yang_data_new_prefix(const char *xpath,
union prefixconstptr prefix);
-extern void yang_dnode_get_prefix(union prefixptr prefix,
+extern void yang_dnode_get_prefix(struct prefix *prefix,
const struct lyd_node *dnode,
const char *xpath_fmt, ...);
extern void yang_get_default_prefix(union prefixptr var, const char *xpath_fmt,