diff options
Diffstat (limited to 'lib/isc/inet_pton.c')
| -rw-r--r-- | lib/isc/inet_pton.c | 6 | 
1 files changed, 3 insertions, 3 deletions
| diff --git a/lib/isc/inet_pton.c b/lib/isc/inet_pton.c index eac631b58ea34..7e07667266643 100644 --- a/lib/isc/inet_pton.c +++ b/lib/isc/inet_pton.c @@ -170,7 +170,7 @@ inet_pton6(const char *src, unsigned char *dst) {  				colonp = tp;  				continue;  			} -			if (tp + NS_INT16SZ > endp) +			if (NS_INT16SZ > endp - tp)  				return (0);  			*tp++ = (unsigned char) (val >> 8) & 0xff;  			*tp++ = (unsigned char) val & 0xff; @@ -178,7 +178,7 @@ inet_pton6(const char *src, unsigned char *dst) {  			val = 0;  			continue;  		} -		if (ch == '.' && ((tp + NS_INADDRSZ) <= endp) && +		if (ch == '.' && (NS_INADDRSZ <= endp - tp) &&  		    inet_pton4(curtok, tp) > 0) {  			tp += NS_INADDRSZ;  			seen_xdigits = 0; @@ -187,7 +187,7 @@ inet_pton6(const char *src, unsigned char *dst) {  		return (0);  	}  	if (seen_xdigits) { -		if (tp + NS_INT16SZ > endp) +		if (NS_INT16SZ > endp - tp)  			return (0);  		*tp++ = (unsigned char) (val >> 8) & 0xff;  		*tp++ = (unsigned char) val & 0xff; | 
