1
0
Fork 0
mirror of https://github.com/warmcat/libwebsockets.git synced 2025-03-30 00:00:16 +01:00

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.
This commit is contained in:
Andy Green 2019-12-01 18:04:19 +00:00
parent 6a40a3ba43
commit b4449e9f12

View file

@ -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)