From 8530d396c117806689b19da1c9a1cd0524c1680d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20R=C3=BChsen?= Date: Fri, 3 Nov 2017 12:10:05 +0100 Subject: [PATCH] Fix unsigned integer overflow in _mem_is_ascii() Found by OSS-Fuzz. It has no impact. --- src/psl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/psl.c b/src/psl.c index 8018340..1691d5c 100644 --- a/src/psl.c +++ b/src/psl.c @@ -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;