Flawfinder version 2.0.10, (C) 2001-2019 David A. Wheeler. Number of rules (primarily dangerous function names) in C/C++ ruleset: 223 Examining data/libfastjson-0.99.8/json_print.c Examining data/libfastjson-0.99.8/json_version.c Examining data/libfastjson-0.99.8/json_object.c Examining data/libfastjson-0.99.8/json_util.h Examining data/libfastjson-0.99.8/tests/test4.c Examining data/libfastjson-0.99.8/tests/test_parse_int64.c Examining data/libfastjson-0.99.8/tests/testReplaceExisting.c Examining data/libfastjson-0.99.8/tests/test_obj_obj_get_ex-null.c Examining data/libfastjson-0.99.8/tests/test_charcase.c Examining data/libfastjson-0.99.8/tests/test_float.c Examining data/libfastjson-0.99.8/tests/chk_version.c Examining data/libfastjson-0.99.8/tests/test_locale.c Examining data/libfastjson-0.99.8/tests/test_many_subobj.c Examining data/libfastjson-0.99.8/tests/cr_obj_multi.c Examining data/libfastjson-0.99.8/tests/test2.c Examining data/libfastjson-0.99.8/tests/test_obj_iter-del.c Examining data/libfastjson-0.99.8/tests/test_object_object_add_ex.c Examining data/libfastjson-0.99.8/tests/test_printbuf.c Examining data/libfastjson-0.99.8/tests/test_parse.c Examining data/libfastjson-0.99.8/tests/ucs_copyright_char.c Examining data/libfastjson-0.99.8/tests/parse_flags.c Examining data/libfastjson-0.99.8/tests/test_cast.c Examining data/libfastjson-0.99.8/tests/test1.c Examining data/libfastjson-0.99.8/tests/parse_flags.h Examining data/libfastjson-0.99.8/debug.c Examining data/libfastjson-0.99.8/printbuf.h Examining data/libfastjson-0.99.8/json_util.c Examining data/libfastjson-0.99.8/atomic.h Examining data/libfastjson-0.99.8/json.h Examining data/libfastjson-0.99.8/printbuf.c Examining data/libfastjson-0.99.8/json_object_iterator.c Examining data/libfastjson-0.99.8/json_object_iterator.h Examining data/libfastjson-0.99.8/json_object.h Examining data/libfastjson-0.99.8/debug.h Examining data/libfastjson-0.99.8/json_tokener.h Examining data/libfastjson-0.99.8/arraylist.h Examining data/libfastjson-0.99.8/json_object_private.h Examining data/libfastjson-0.99.8/json_tokener.c Examining data/libfastjson-0.99.8/arraylist.c FINAL RESULTS: data/libfastjson-0.99.8/debug.c:54:3: [4] (format) vprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. vprintf(msg, ap); data/libfastjson-0.99.8/debug.c:68:2: [4] (format) vfprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. vfprintf(stderr, msg, ap); data/libfastjson-0.99.8/debug.c:81:2: [4] (format) vfprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. vfprintf(stderr, msg, ap); data/libfastjson-0.99.8/debug.h:25:31: [4] (format) syslog: If syslog's format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant format string for syslog. extern void mc_set_syslog(int syslog); data/libfastjson-0.99.8/debug.h:27:66: [4] (format) printf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. extern void mc_debug(const char *msg, ...) __attribute__((format(printf, 1, 2))); data/libfastjson-0.99.8/debug.h:28:66: [4] (format) printf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. extern void mc_error(const char *msg, ...) __attribute__((format(printf, 1, 2))); data/libfastjson-0.99.8/debug.h:29:65: [4] (format) printf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. extern void mc_info(const char *msg, ...) __attribute__((format(printf, 1, 2))); data/libfastjson-0.99.8/json_object.c:39:40: [4] (shell) system: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. # error You do not have strdup on your system. data/libfastjson-0.99.8/json_object.c:43:25: [4] (format) snprintf: If format strings can be influenced by an attacker, they can be exploited, and note that sprintf variations do not always \0-terminate (CWE-134). Use a constant for the format specification. # error You do not have snprintf on your system. data/libfastjson-0.99.8/json_object.c:43:42: [4] (shell) system: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. # error You do not have snprintf on your system. data/libfastjson-0.99.8/json_object.c:702:10: [4] (format) snprintf: If format strings can be influenced by an attacker, they can be exploited, and note that sprintf variations do not always \0-terminate (CWE-134). Use a constant for the format specification. size = snprintf(buf, sizeof(buf), data/libfastjson-0.99.8/json_print.c:35:25: [4] (format) snprintf: If format strings can be influenced by an attacker, they can be exploited, and note that sprintf variations do not always \0-terminate (CWE-134). Use a constant for the format specification. # error You do not have snprintf on your system. data/libfastjson-0.99.8/json_print.c:35:42: [4] (shell) system: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. # error You do not have snprintf on your system. data/libfastjson-0.99.8/json_print.c:59:10: [4] (format) vsnprintf: If format strings can be influenced by an attacker, they can be exploited, and note that sprintf variations do not always \0-terminate (CWE-134). Use a constant for the format specification. chars = vsnprintf(&_T_emptybuffer, 0, fmt, ap)+1; data/libfastjson-0.99.8/json_print.c:65:14: [4] (format) vsprintf: Potential format string problem (CWE-134). Make format string constant. if((chars = vsprintf(b, fmt, ap)) < 0) { data/libfastjson-0.99.8/json_print.c:161:9: [4] (format) vsnprintf: If format strings can be influenced by an attacker, they can be exploited, and note that sprintf variations do not always \0-terminate (CWE-134). Use a constant for the format specification. size = vsnprintf(buffer->buffer + buffer->filled, buffer->size - buffer->filled - 1, format, arguments); data/libfastjson-0.99.8/json_print.c:184:19: [4] (format) vsnprintf: If format strings can be influenced by an attacker, they can be exploited, and note that sprintf variations do not always \0-terminate (CWE-134). Use a constant for the format specification. buffer->size += vsnprintf(buffer->buffer + buffer->filled, data/libfastjson-0.99.8/json_tokener.c:46:39: [4] (shell) system: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. #error You do not have strdup on your system. data/libfastjson-0.99.8/json_tokener.c:50:44: [4] (shell) system: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. #error You do not have strncasecmp on your system. data/libfastjson-0.99.8/json_util.c:41:25: [4] (format) snprintf: If format strings can be influenced by an attacker, they can be exploited, and note that sprintf variations do not always \0-terminate (CWE-134). Use a constant for the format specification. # error You do not have snprintf on your system. data/libfastjson-0.99.8/json_util.c:41:42: [4] (shell) system: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. # error You do not have snprintf on your system. data/libfastjson-0.99.8/json_util.c:165:8: [4] (buffer) sscanf: The scanf() family's %s operation, without a limit specification, permits buffer overflows (CWE-120, CWE-20). Specify a limit to %s, or use a different input function. If the scanf format is influenceable by an attacker, it's exploitable. (void)sscanf(" -01234567890123456789012345", "%" SCNd64, &num64); data/libfastjson-0.99.8/json_util.c:169:8: [4] (buffer) sscanf: The scanf() family's %s operation, without a limit specification, permits buffer overflows (CWE-120, CWE-20). Specify a limit to %s, or use a different input function. If the scanf format is influenceable by an attacker, it's exploitable. (void)sscanf(" 01234567890123456789012345", "%" SCNd64, &num64); data/libfastjson-0.99.8/json_util.c:199:6: [4] (buffer) sscanf: The scanf() family's %s operation, without a limit specification, permits buffer overflows (CWE-120, CWE-20). Specify a limit to %s, or use a different input function. If the scanf format is influenceable by an attacker, it's exploitable. if (sscanf(buf, "%" SCNd64, &num64) != 1) data/libfastjson-0.99.8/json_util.c:228:3: [4] (format) snprintf: If format strings can be influenced by an attacker, they can be exploited, and note that sprintf variations do not always \0-terminate (CWE-134). Use a constant for the format specification. snprintf(buf_cmp_start, sizeof(buf_cmp), "%" PRId64, num64); data/libfastjson-0.99.8/printbuf.c:154:14: [4] (format) vsnprintf: If format strings can be influenced by an attacker, they can be exploited, and note that sprintf variations do not always \0-terminate (CWE-134). Use a constant for the format specification. # error Need vsnprintf! data/libfastjson-0.99.8/printbuf.c:178:10: [4] (format) vsnprintf: If format strings can be influenced by an attacker, they can be exploited, and note that sprintf variations do not always \0-terminate (CWE-134). Use a constant for the format specification. chars = vsnprintf(&_T_emptybuffer, 0, fmt, ap)+1; data/libfastjson-0.99.8/printbuf.c:184:14: [4] (format) vsprintf: Potential format string problem (CWE-134). Make format string constant. if((chars = vsprintf(b, fmt, ap)) < 0) { data/libfastjson-0.99.8/printbuf.c:204:9: [4] (format) vsnprintf: If format strings can be influenced by an attacker, they can be exploited, and note that sprintf variations do not always \0-terminate (CWE-134). Use a constant for the format specification. size = vsnprintf(buf, 128, msg, ap); data/libfastjson-0.99.8/tests/parse_flags.c:11:44: [4] (shell) system: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. # error You do not have strcasecmp on your system. data/libfastjson-0.99.8/json_object.c:108:1: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char char_needsEscape[256] = { data/libfastjson-0.99.8/json_object.c:680:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf[128], *p, *q; data/libfastjson-0.99.8/json_object.c:842:3: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(jso->o.c_string.str.data, s, jso->o.c_string.len); data/libfastjson-0.99.8/json_object.c:875:2: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(dstbuf, (void *)s, len); data/libfastjson-0.99.8/json_object_private.h:85:4: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char data[LEN_DIRECT_STRING_DATA]; data/libfastjson-0.99.8/json_print.c:127:2: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(buffer->buffer + buffer->filled, data, size); data/libfastjson-0.99.8/json_print.c:261:14: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. extern const char char_needsEscape[256]; data/libfastjson-0.99.8/json_print.c:535:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buffer[1024]; data/libfastjson-0.99.8/json_tokener.c:69:7: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. const char *fjson_tokener_errors[15] = { data/libfastjson-0.99.8/json_tokener.c:104:17: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. static unsigned char utf8_replacement_char[3] = { 0xEF, 0xBF, 0xBD }; data/libfastjson-0.99.8/json_tokener.c:552:17: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. unsigned char unescaped_utf[4]; data/libfastjson-0.99.8/json_util.c:66:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf[FJSON_FILE_BUF_SIZE]; data/libfastjson-0.99.8/json_util.c:91:11: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). if((fd = open(filename, O_RDONLY)) < 0) { data/libfastjson-0.99.8/json_util.c:114:11: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). if((fd = open(filename, O_WRONLY | O_TRUNC | O_CREAT, 0644)) < 0) { data/libfastjson-0.99.8/json_util.c:217:3: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf_cmp[100]; data/libfastjson-0.99.8/printbuf.c:93:3: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(p->buf + p->bpos, buf, size); data/libfastjson-0.99.8/printbuf.c:109:2: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(p->buf + p->bpos, buf, size); data/libfastjson-0.99.8/printbuf.c:200:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf[128]; data/libfastjson-0.99.8/printbuf.h:43:3: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(p->buf + p->bpos, (bufptr), bufsize); \ data/libfastjson-0.99.8/tests/cr_obj_multi.c:23:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char pb[64]; data/libfastjson-0.99.8/tests/test_many_subobj.c:25:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char pb[64]; data/libfastjson-0.99.8/tests/test_parse_int64.c:26:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf[100]; data/libfastjson-0.99.8/tests/test_parse_int64.c:38:2: [2] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). Risk is low because the source is a constant string. strcpy(buf, "2147483647"); // aka INT32_MAX data/libfastjson-0.99.8/tests/test_parse_int64.c:41:2: [2] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). Risk is low because the source is a constant string. strcpy(buf, "-1"); data/libfastjson-0.99.8/tests/test_parse_int64.c:44:2: [2] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). Risk is low because the source is a constant string. strcpy(buf, " -1"); data/libfastjson-0.99.8/tests/test_parse_int64.c:47:2: [2] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). Risk is low because the source is a constant string. strcpy(buf, "00001234"); data/libfastjson-0.99.8/tests/test_parse_int64.c:50:2: [2] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). Risk is low because the source is a constant string. strcpy(buf, "0001234x"); data/libfastjson-0.99.8/tests/test_parse_int64.c:53:2: [2] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). Risk is low because the source is a constant string. strcpy(buf, "-00001234"); data/libfastjson-0.99.8/tests/test_parse_int64.c:56:2: [2] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). Risk is low because the source is a constant string. strcpy(buf, "-00001234x"); data/libfastjson-0.99.8/tests/test_parse_int64.c:59:2: [2] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). Risk is low because the source is a constant string. strcpy(buf, "4294967295"); // aka UINT32_MAX data/libfastjson-0.99.8/tests/test_parse_int64.c:61:2: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(buf, "4294967296"); // aka UINT32_MAX + 1 data/libfastjson-0.99.8/tests/test_parse_int64.c:63:2: [2] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). Risk is low because the source is a constant string. strcpy(buf, "21474836470"); // INT32_MAX * 10 data/libfastjson-0.99.8/tests/test_parse_int64.c:66:2: [2] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). Risk is low because the source is a constant string. strcpy(buf, "31474836470"); // INT32_MAX * 10 + a bunch data/libfastjson-0.99.8/tests/test_parse_int64.c:69:2: [2] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). Risk is low because the source is a constant string. strcpy(buf, "-2147483647"); // INT32_MIN + 1 data/libfastjson-0.99.8/tests/test_parse_int64.c:72:2: [2] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). Risk is low because the source is a constant string. strcpy(buf, "-2147483648"); // INT32_MIN data/libfastjson-0.99.8/tests/test_parse_int64.c:75:2: [2] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). Risk is low because the source is a constant string. strcpy(buf, "-2147483649"); // INT32_MIN - 1 data/libfastjson-0.99.8/tests/test_parse_int64.c:78:2: [2] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). Risk is low because the source is a constant string. strcpy(buf, "-21474836480"); // INT32_MIN * 10 data/libfastjson-0.99.8/tests/test_parse_int64.c:81:2: [2] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). Risk is low because the source is a constant string. strcpy(buf, "9223372036854775806"); // INT64_MAX - 1 data/libfastjson-0.99.8/tests/test_parse_int64.c:84:2: [2] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). Risk is low because the source is a constant string. strcpy(buf, "9223372036854775807"); // INT64_MAX data/libfastjson-0.99.8/tests/test_parse_int64.c:87:2: [2] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). Risk is low because the source is a constant string. strcpy(buf, "9223372036854775808"); // INT64_MAX + 1 data/libfastjson-0.99.8/tests/test_parse_int64.c:90:2: [2] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). Risk is low because the source is a constant string. strcpy(buf, "-9223372036854775808"); // INT64_MIN data/libfastjson-0.99.8/tests/test_parse_int64.c:93:2: [2] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). Risk is low because the source is a constant string. strcpy(buf, "-9223372036854775809"); // INT64_MIN - 1 data/libfastjson-0.99.8/tests/test_parse_int64.c:96:2: [2] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). Risk is low because the source is a constant string. strcpy(buf, "18446744073709551614"); // UINT64_MAX - 1 data/libfastjson-0.99.8/tests/test_parse_int64.c:99:2: [2] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). Risk is low because the source is a constant string. strcpy(buf, "18446744073709551615"); // UINT64_MAX data/libfastjson-0.99.8/tests/test_parse_int64.c:103:2: [2] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). Risk is low because the source is a constant string. strcpy(buf, "123"); data/libfastjson-0.99.8/json_object.c:685:57: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). printbuf_memappend_no_nul(pb, jso->o.c_double.source, strlen(jso->o.c_double.source)); data/libfastjson-0.99.8/json_object.c:840:24: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). jso->o.c_string.len = strlen(s); data/libfastjson-0.99.8/json_print.c:389:83: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (jso->o.c_double.source) return buffer_append(buffer, jso->o.c_double.source, strlen(jso->o.c_double.source)); data/libfastjson-0.99.8/json_tokener.c:257:34: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if ((len < -1) || (len == -1 && strlen(str) > INT32_MAX)) { data/libfastjson-0.99.8/json_util.c:73:15: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). while((ret = read(fd, buf, FJSON_FILE_BUF_SIZE)) > 0) { data/libfastjson-0.99.8/json_util.c:125:25: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). wsize = (unsigned int)(strlen(fjson_str) & UINT_MAX); /* CAW: probably unnecessary, but the most 64bit safe */ data/libfastjson-0.99.8/json_util.c:236:17: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). buf_cmp_len = strlen(buf_cmp_start); data/libfastjson-0.99.8/json_util.c:244:46: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). strncmp(buf_sig_digits, buf_cmp_start, strlen(buf_cmp_start)) != 0 || data/libfastjson-0.99.8/json_util.c:245:10: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). ((int)strlen(buf_sig_digits) != buf_cmp_len && data/libfastjson-0.99.8/tests/test_parse.c:288:13: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). length = strlen(step->string_to_parse); data/libfastjson-0.99.8/tests/test_printbuf.c:128:127: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). printf("sprintbuf to just after resize(%d+1): %d, [%s], strlen(buf)=%d\n", before_resize, printbuf_length(pb), pb->buf, (int)strlen(pb->buf)); ANALYSIS SUMMARY: Hits = 86 Lines analyzed = 6978 in approximately 0.26 seconds (26533 lines/second) Physical Source Lines of Code (SLOC) = 4404 Hits@level = [0] 172 [1] 11 [2] 45 [3] 0 [4] 30 [5] 0 Hits@level+ = [0+] 258 [1+] 86 [2+] 75 [3+] 30 [4+] 30 [5+] 0 Hits/KSLOC@level+ = [0+] 58.5831 [1+] 19.5277 [2+] 17.03 [3+] 6.81199 [4+] 6.81199 [5+] 0 Dot directories skipped = 1 (--followdotdir overrides) Minimum risk level = 1 Not every hit is necessarily a security vulnerability. There may be other security vulnerabilities; review your code! See 'Secure Programming HOWTO' (https://dwheeler.com/secure-programs) for more information.