ospfd zebra: array overrun fixes (PVS-Studio)

Signed-off-by: F. Aragon <paco@voltanet.io>
This commit is contained in:
F. Aragon 2018-07-02 16:30:40 +02:00
parent 8d6d6b2581
commit e1fa928d22
No known key found for this signature in database
GPG Key ID: FD112A8C7E6A5E4A
2 changed files with 3 additions and 3 deletions

View File

@ -91,7 +91,7 @@ struct external_info *ospf_external_info_check(struct ospf *ospf,
p.prefix = lsa->data->id;
p.prefixlen = ip_masklen(al->mask);
for (type = 0; type <= ZEBRA_ROUTE_MAX; type++) {
for (type = 0; type < ZEBRA_ROUTE_MAX; type++) {
int redist_on = 0;
redist_on =

View File

@ -274,7 +274,7 @@ void zebra_redistribute_add(ZAPI_HANDLER_ARGS)
__func__, zebra_route_string(client->proto), afi,
zebra_route_string(type), zvrf_id(zvrf), instance);
if (afi == 0 || afi > AFI_MAX) {
if (afi == 0 || afi >= AFI_MAX) {
zlog_warn("%s: Specified afi %d does not exist",
__PRETTY_FUNCTION__, afi);
return;
@ -320,7 +320,7 @@ void zebra_redistribute_delete(ZAPI_HANDLER_ARGS)
STREAM_GETC(msg, type);
STREAM_GETW(msg, instance);
if (afi == 0 || afi > AFI_MAX) {
if (afi == 0 || afi >= AFI_MAX) {
zlog_warn("%s: Specified afi %d does not exist",
__PRETTY_FUNCTION__, afi);
return;