From a7e046a20aae684e9f4e9e634441841297b1359c Mon Sep 17 00:00:00 2001 From: Donald Sharp Date: Wed, 16 Jan 2019 20:43:53 -0500 Subject: [PATCH] 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 --- bgpd/bgp_clist.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bgpd/bgp_clist.h b/bgpd/bgp_clist.h index 9cf8a14a6a..75a31611ba 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 */ -- 2.39.5