From: Adam Sutton Date: Tue, 15 Jan 2013 17:28:51 +0000 (+0000) Subject: access: fix infinite loop bug in ipv6 check X-Git-Tag: v3.5~89 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8d2da9389df581923c462ca04c7ee35a072e675a;p=thirdparty%2Ftvheadend.git access: fix infinite loop bug in ipv6 check Thanks to BtBN for spotting this (though it was his code!). --- diff --git a/src/access.c b/src/access.c index a595986da..3e7614d5f 100644 --- a/src/access.c +++ b/src/access.c @@ -203,11 +203,13 @@ netmask_verify(access_entry_t *ae, struct sockaddr *src) while(slen >= 8) { if(a8[apos] != m8[apos]) - continue; + break; apos += 1; slen -= 8; } + if(slen >= 8) + continue; if(slen == 0 || (a8[apos] & lastMask) == (m8[apos] & lastMask)) return 1;