Skip to content

Commit

Permalink
Fix unsigned integer overflow in _mem_is_ascii()
Browse files Browse the repository at this point in the history
Found by OSS-Fuzz. It has no impact.
  • Loading branch information
rockdaboot committed Nov 3, 2017
1 parent 16bf63a commit 1c44781
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/psl.c
Original file line number Diff line number Diff line change
Expand Up @@ -549,7 +549,7 @@ static ssize_t _utf8_to_utf32(const char *in, size_t inlen, punycode_uint *out,

static int _mem_is_ascii(const char *s, size_t n)
{
while (n--)
for (; n; n--) /* 'while(n--)' generates unsigned integer overflow on n = 0 */
if (*((unsigned char *)s++) >= 128)
return 0;

Expand Down

0 comments on commit 1c44781

Please sign in to comment.