Project homepage Mailing List  Warmcat.com  API Docs  Github Mirror 
{"schema":"libjg2-1", "vpath":"/git/", "avatar":"/git/avatar/", "alang":"", "gen_ut":1752656814, "reponame":"libwebsockets", "desc":"libwebsockets lightweight C networking library", "owner": { "name": "Andy Green", "email": "andy@warmcat.com", "md5": "c50933ca2aa61e0fe2c43d46bb6b59cb" },"url":"https://libwebsockets.org/repo/libwebsockets", "f":3, "items": [ {"schema":"libjg2-1", "cid":"a5a4b9ad5db4903a9cf2a07e498b8ceb", "commit": {"type":"commit", "time": 1575223459, "time_ofs": 0, "oid_tree": { "oid": "b8a9207d33ecfe6822fa07cc35295794161b8e19", "alias": []}, "oid":{ "oid": "b4449e9f124f12134a871a2e25f42ef04cb89005", "alias": []}, "msg": "semmle: char comparison is actually constrained", "sig_commit": { "git_time": { "time": 1575223459, "offset": 0 }, "name": "Andy Green", "email": "andy@warmcat.com", "md5": "c50933ca2aa61e0fe2c43d46bb6b59cb" }, "sig_author": { "git_time": { "time": 1575223459, "offset": 0 }, "name": "Andy Green", "email": "andy@warmcat.com", "md5": "c50933ca2aa61e0fe2c43d46bb6b59cb" }}, "body": "semmle: char comparison is actually constrained\n\nIt looks to semmle like the int size can be bigger than the char loop var.\nBut the size is the size of the IPv4 or IPv6 address, so it cannot make\na problem." , "diff": "diff --git a/lib/core-net/network.c b/lib/core-net/network.c\nindex 1802972..feab9fa 100644\n--- a/lib/core-net/network.c\n+++ b/lib/core-net/network.c\n@@ -744,7 +744,7 @@ lws_write_numeric_address(const uint8_t *ads, int size, char *buf, int len)\n \tif (size !\u003d 16)\n \t\treturn -1;\n \n-\tfor (c \u003d 0; c \u003c size / 2; c++) {\n+\tfor (c \u003d 0; c \u003c (char)size / 2; c++) {\n \t\tuint16_t v \u003d (ads[q] \u003c\u003c 8) | ads[q + 1];\n \n \t\tif (buf + 8 \u003e e)\n","s":{"c":1752656814,"u": 1907}} ],"g": 3245,"chitpc": 0,"ehitpc": 0,"indexed":0 , "ab": 0, "si": 0, "db":0, "di":0, "sat":0, "lfc": "0000"}