]> git.puffer.fish Git - matthieu/frr.git/commitdiff
zebra: Compare to the number of elements not size of array
authorDonald Sharp <sharpd@cumulusnetworks.com>
Mon, 19 Mar 2018 01:30:27 +0000 (21:30 -0400)
committerDonald Sharp <sharpd@cumulusnetworks.com>
Mon, 19 Mar 2018 13:18:10 +0000 (09:18 -0400)
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 <sharpd@cumulusnetworks.com>
zebra/zserv.c

index 57b1be4b8b2bc8cb74187ac31a78cfa01e4f9fc1..5b279a7cb29f57941d59e23156a574cf6bb4f540 100644 (file)
@@ -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