Browse Source

Unsafe function usage.

According to standards for C Language, high Risk to  use strcat(). It should be replaced by strncat.
pull/789/head
Eibz-Chan GitHub 3 years ago
parent
commit
15ddc4a504
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions
  1. +1
    -1
      json_object.c

+ 1
- 1
json_object.c View File

@@ -1047,7 +1047,7 @@ static int json_object_double_to_json_string_format(struct json_object *jso, str
{
// Ensure it looks like a float, even if snprintf didn't,
// unless a custom format is set to omit the decimal.
strcat(buf, ".0");
strncat(buf, ".0", 2);
size += 2;
}
if (p && (flags & JSON_C_TO_STRING_NOZERO))


Loading…
Cancel
Save