Skip to content

Commit

Permalink
prevent an infinite loop when the ip->ipNetToMediaEntrySize is 0
Browse files Browse the repository at this point in the history
  • Loading branch information
postwait committed Mar 22, 2014
1 parent 1f07cc5 commit f20ac59
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions arpcache-dlpi.cc
Expand Up @@ -128,6 +128,7 @@ int sample_arp_cache(arp_entry **l) {
for(np = (mib2_ipNetToMediaEntry_t *)dbuf;
(char *)np < (char *)dbuf + databuf.len;
np = (mib2_ipNetToMediaEntry_t *)((char *)np + ip->ipNetToMediaEntrySize)) {
if(ip->ipNetToMediaEntrySize == 0) break;
if(count >= arpcache_psize) {
arpcache_psize <<= 1;
arpcache_private = (arp_entry *)realloc(arpcache_private, sizeof(arp_entry)*(arpcache_psize+1));
Expand Down

0 comments on commit f20ac59

Please sign in to comment.