summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDonald Sharp <sharpd@cumulusnetworks.com>2019-01-17 02:43:53 +0100
committerDonald Sharp <sharpd@cumulusnetworks.com>2019-01-17 02:43:53 +0100
commita7e046a20aae684e9f4e9e634441841297b1359c (patch)
tree6b1a34a226f0c04b61f0634e1aabb1c05bbbcaf2
parentMerge pull request #3624 from mjstapp/fix_ldpd_bind (diff)
downloadfrr-a7e046a20aae684e9f4e9e634441841297b1359c.tar.xz
frr-a7e046a20aae684e9f4e9e634441841297b1359c.zip
bgpd: Use string length not sizeof the array
strlen is the same as sizeof when the memory is dynamically allocated but it is not the same when the memory being looked at is an array. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
-rw-r--r--bgpd/bgp_clist.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/bgpd/bgp_clist.h b/bgpd/bgp_clist.h
index 9cf8a14a6..75a31611b 100644
--- a/bgpd/bgp_clist.h
+++ b/bgpd/bgp_clist.h
@@ -173,7 +173,7 @@ lcommunity_list_match_delete(struct lcommunity *lcom,
static inline uint32_t bgp_clist_hash_key(char *name)
{
- return jhash(name, sizeof(name), 0xdeadbeaf);
+ return jhash(name, strlen(name), 0xdeadbeaf);
}
#endif /* _QUAGGA_BGP_CLIST_H */