mirror of
https://github.com/json-c/json-c.git
synced 2026-03-25 16:09:06 +08:00
Merge pull request #739 from rouault/avoid_unsigned_integer_overflow
json_escape_str(): avoid harmless unsigned integer overflow
This commit is contained in:
@@ -180,8 +180,9 @@ static int json_escape_str(struct printbuf *pb, const char *str, size_t len, int
|
||||
{
|
||||
size_t pos = 0, start_offset = 0;
|
||||
unsigned char c;
|
||||
while (len--)
|
||||
while (len)
|
||||
{
|
||||
--len;
|
||||
c = str[pos];
|
||||
switch (c)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user