From b4449e9f124f12134a871a2e25f42ef04cb89005 Mon Sep 17 00:00:00 2001 From: Andy Green Date: Sun, 1 Dec 2019 18:04:19 +0000 Subject: [PATCH] semmle: char comparison is actually constrained It looks to semmle like the int size can be bigger than the char loop var. But the size is the size of the IPv4 or IPv6 address, so it cannot make a problem. --- lib/core-net/network.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/core-net/network.c b/lib/core-net/network.c index 180297297..feab9fa91 100644 --- a/lib/core-net/network.c +++ b/lib/core-net/network.c @@ -744,7 +744,7 @@ lws_write_numeric_address(const uint8_t *ads, int size, char *buf, int len) if (size != 16) return -1; - for (c = 0; c < size / 2; c++) { + for (c = 0; c < (char)size / 2; c++) { uint16_t v = (ads[q] << 8) | ads[q + 1]; if (buf + 8 > e)