]> git.proxmox.com Git - mirror_frr.git/commitdiff
Merge pull request #2406 from pacovn/Coverity_1465495_Out-of-bounds_read
authorRafael Zalamena <rzalamena@users.noreply.github.com>
Tue, 12 Jun 2018 14:45:11 +0000 (11:45 -0300)
committerGitHub <noreply@github.com>
Tue, 12 Jun 2018 14:45:11 +0000 (11:45 -0300)
zebra: Out-of-bounds read (Coverity 1465495)

zebra/zapi_msg.c

index b17bbc95c26ceab0b2fa6f6bebeb002a797420f8..853a83373dbdfdeeeb887977e999caacaa0eb755 100644 (file)
@@ -3061,7 +3061,7 @@ void zserv_handle_commands(struct zserv *client, struct stream *msg)
                return;
        }
 
-       if (hdr.command > array_size(zserv_handlers)
+       if (hdr.command >= array_size(zserv_handlers)
            || zserv_handlers[hdr.command] == NULL)
                zlog_info("Zebra received unknown command %d", hdr.command);
        else