From: Donald Sharp Date: Mon, 19 Mar 2018 01:30:27 +0000 (-0400) Subject: zebra: Compare to the number of elements not size of array X-Git-Tag: frr-5.0-dev~142^2~3 X-Git-Url: https://git.puffer.fish/?a=commitdiff_plain;h=149a38a3134968cacc3dec024ef2cbbe17000174;p=matthieu%2Ffrr.git zebra: Compare to the number of elements not size of array When figuring out whom to call and if we actually can legally call into the handler array actually use the number of elements in the array instead of the size of the array. Signed-off-by: Donald Sharp --- diff --git a/zebra/zserv.c b/zebra/zserv.c index 57b1be4b8b..5b279a7cb2 100644 --- a/zebra/zserv.c +++ b/zebra/zserv.c @@ -2614,7 +2614,7 @@ static inline void zserv_handle_commands(struct zserv *client, struct stream *msg, struct zebra_vrf *zvrf) { - if (hdr->command > sizeof(zserv_handlers) + if (hdr->command > array_size(zserv_handlers) || zserv_handlers[hdr->command] == NULL) zlog_info("Zebra received unknown command %d", hdr->command); else