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/jq-1.6/src/jv.h Examining data/jq-1.6/src/main.c Examining data/jq-1.6/src/jv_alloc.c Examining data/jq-1.6/src/jv_alloc.h Examining data/jq-1.6/src/bytecode.c Examining data/jq-1.6/src/jv_parse.c Examining data/jq-1.6/src/exec_stack.h Examining data/jq-1.6/src/inject_errors.c Examining data/jq-1.6/src/lexer.h Examining data/jq-1.6/src/builtin.h Examining data/jq-1.6/src/opcode_list.h Examining data/jq-1.6/src/linker.h Examining data/jq-1.6/src/jv_dtoa.h Examining data/jq-1.6/src/jv_unicode.c Examining data/jq-1.6/src/compile.c Examining data/jq-1.6/src/compile.h Examining data/jq-1.6/src/jv_utf8_tables.h Examining data/jq-1.6/src/parser.c Examining data/jq-1.6/src/parser.h Examining data/jq-1.6/src/util.h Examining data/jq-1.6/src/libm.h Examining data/jq-1.6/src/jv_file.c Examining data/jq-1.6/src/builtin.c Examining data/jq-1.6/src/bytecode.h Examining data/jq-1.6/src/locfile.h Examining data/jq-1.6/src/linker.c Examining data/jq-1.6/src/jv_aux.c Examining data/jq-1.6/src/lexer.c Examining data/jq-1.6/src/jv_dtoa.c Examining data/jq-1.6/src/jv_unicode.h Examining data/jq-1.6/src/jq.h Examining data/jq-1.6/src/jq_parser.h Examining data/jq-1.6/src/locfile.c Examining data/jq-1.6/src/util.c Examining data/jq-1.6/src/execute.c Examining data/jq-1.6/src/jv.c Examining data/jq-1.6/src/jv_print.c Examining data/jq-1.6/src/jq_test.c FINAL RESULTS: data/jq-1.6/src/compile.c:390:5: [4] (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). strcpy(matchname,libname); data/jq-1.6/src/compile.c:399:5: [4] (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). strcpy(tname, matchname); data/jq-1.6/src/compile.c:400:5: [4] (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). strcpy(tname+matchlen, curr->symbol); data/jq-1.6/src/jv.c:832:13: [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. int n = vsnprintf(buf, size, fmt, ap2); data/jq-1.6/src/jv_dtoa.c:1655:4: [4] (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). strcpy((char*)decimalpoint_cache, (CONST char*)s0); data/jq-1.6/src/parser.c:1459:21: [4] (format) fprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. # define YYFPRINTF fprintf data/jq-1.6/src/util.c:70:3: [4] (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). strcpy(s, template); data/jq-1.6/src/util.c:74:5: [4] (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). strcpy(template, s); data/jq-1.6/src/util.c:75:12: [4] (tmpfile) mktemp: Temporary file race condition (CWE-377). (void) mktemp(template); data/jq-1.6/src/builtin.c:1210:14: [3] (buffer) getenv: Environment variables are untrustable input if they can be set by an attacker. They can have any content and length, and the same variable can be set more than once (CWE-807, CWE-20). Check environment variables carefully before using them. tz = (tz = getenv("TZ")) != NULL ? strdup(tz) : NULL; data/jq-1.6/src/builtin.c:1761:16: [3] (buffer) getenv: Environment variables are untrustable input if they can be set by an attacker. They can have any content and length, and the same variable can be set more than once (CWE-807, CWE-20). Check environment variables carefully before using them. char* home = getenv("HOME"); data/jq-1.6/src/main.c:537:7: [3] (buffer) getenv: Environment variables are untrustable input if they can be set by an attacker. They can have any content and length, and the same variable can be set more than once (CWE-807, CWE-20). Check environment variables carefully before using them. if (getenv("JQ_COLORS") != NULL && !jq_set_colors(getenv("JQ_COLORS"))) data/jq-1.6/src/main.c:537:53: [3] (buffer) getenv: Environment variables are untrustable input if they can be set by an attacker. They can have any content and length, and the same variable can be set more than once (CWE-807, CWE-20). Check environment variables carefully before using them. if (getenv("JQ_COLORS") != NULL && !jq_set_colors(getenv("JQ_COLORS"))) data/jq-1.6/src/util.c:103:16: [3] (buffer) getenv: Environment variables are untrustable input if they can be set by an attacker. They can have any content and length, and the same variable can be set more than once (CWE-807, CWE-20). Check environment variables carefully before using them. char *home = getenv("HOME"); data/jq-1.6/src/util.c:112:12: [3] (buffer) getenv: Environment variables are untrustable input if they can be set by an attacker. They can have any content and length, and the same variable can be set more than once (CWE-807, CWE-20). Check environment variables carefully before using them. home = getenv("USERPROFILE"); data/jq-1.6/src/util.c:114:18: [3] (buffer) getenv: Environment variables are untrustable input if they can be set by an attacker. They can have any content and length, and the same variable can be set more than once (CWE-807, CWE-20). Check environment variables carefully before using them. char *hd = getenv("HOMEDRIVE"); data/jq-1.6/src/util.c:116:14: [3] (buffer) getenv: Environment variables are untrustable input if they can be set by an attacker. They can have any content and length, and the same variable can be set more than once (CWE-807, CWE-20). Check environment variables carefully before using them. home = getenv("HOMEPATH"); data/jq-1.6/src/util.c:147:15: [3] (buffer) realpath: This function does not protect against buffer overflows, and some implementations can overflow internally (CWE-120/CWE-785!). Ensure that the destination buffer is at least of size MAXPATHLEN, andto protect against implementation problems, the input argument should also be checked to ensure it is no larger than MAXPATHLEN. char *tmp = realpath(jv_string_value(path), buf); data/jq-1.6/src/builtin.c:48: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 errbuf[15]; data/jq-1.6/src/builtin.c:58: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 errbuf1[15],errbuf2[15]; data/jq-1.6/src/builtin.c:465:23: [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 const unsigned char BASE64_ENCODE_TABLE[64 + 1] = CHARS_ALPHANUM "+/"; data/jq-1.6/src/builtin.c:467:23: [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 const unsigned char BASE64_DECODE_TABLE[255] = { data/jq-1.6/src/builtin.c:644: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. char buf[4]; data/jq-1.6/src/compile.c:391:5: [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(matchname+matchlen, "::"); data/jq-1.6/src/execute.c:493:9: [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 errbuf[15]; data/jq-1.6/src/execute.c:631:9: [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 errbuf[30]; data/jq-1.6/src/execute.c:670:9: [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 keybuf[15]; data/jq-1.6/src/execute.c:671:9: [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 objbuf[30]; data/jq-1.6/src/execute.c:717:9: [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 errbuf[30]; data/jq-1.6/src/execute.c:756:11: [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 errbuf[15]; data/jq-1.6/src/inject_errors.c:41:7: [2] (misc) fopen: 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). FILE *fopen(const char *path, const char *mode) { data/jq-1.6/src/inject_errors.c:42:12: [2] (misc) fopen: 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). GET_REAL(fopen); data/jq-1.6/src/jq_test.c:16:16: [2] (misc) fopen: 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). testdata = fopen(argv[0], "r"); data/jq-1.6/src/jq_test.c:42: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[4096]; data/jq-1.6/src/jq_test.c:57: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 prog[4096] = {0}; data/jq-1.6/src/jq_test.c:58: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[4096] = {0}; data/jq-1.6/src/jq_test.c:318:5: [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 big[20000]; data/jq-1.6/src/jv.c:485:5: [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(s->data, data, length); data/jq-1.6/src/jv.c:524:5: [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(s->data + currlen, data, len); data/jq-1.6/src/jv.c:534:5: [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(news->data, s->data, currlen); data/jq-1.6/src/jv.c:535:5: [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(news->data + currlen, data, len); data/jq-1.6/src/jv.c:816: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[5]; data/jq-1.6/src/jv.c:1019: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(new_buckets, old_buckets, sizeof(int) * jvp_object_size(new_object)*2); data/jq-1.6/src/jv_dtoa.c:585:20: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. #define Bcopy(x,y) memcpy((char *)&x->sign, (char *)&y->sign, \ data/jq-1.6/src/jv_dtoa.c:1401: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 hexdig[256]; data/jq-1.6/src/jv_file.c:14:12: [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). int fd = open(filename, O_RDONLY); data/jq-1.6/src/jv_file.c:46: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[4096+max_utf8_len]; data/jq-1.6/src/jv_print.c:34:8: [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 char color_bufs[sizeof(color_kinds)/sizeof(color_kinds[0])][16]; data/jq-1.6/src/jv_print.c:35: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. static const char *color_bufps[8]; data/jq-1.6/src/jv_print.c:85:10: [2] (buffer) MultiByteToWideChar: Requires maximum length in CHARACTERS, not bytes (CWE-120). wl = MultiByteToWideChar(CP_UTF8, 0, s, len, NULL, 0); data/jq-1.6/src/jv_print.c:89:10: [2] (buffer) MultiByteToWideChar: Requires maximum length in CHARACTERS, not bytes (CWE-120). wl = MultiByteToWideChar(CP_UTF8, 0, s, len, ws, wl + 1); data/jq-1.6/src/jv_print.c:126: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[32]; data/jq-1.6/src/jv_print.c:188: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[JVP_DTOA_FMT_MAX_LEN]; data/jq-1.6/src/jv_print.c:196: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[JVP_DTOA_FMT_MAX_LEN]; data/jq-1.6/src/locfile.c:17: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((char*)l->data,data,length); data/jq-1.6/src/main.c:388:22: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). int indent = atoi(argv[i+1]); data/jq-1.6/src/parser.c:312:5: [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 errbuf[15]; data/jq-1.6/src/parser.c:1751: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 const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM]; data/jq-1.6/src/parser.c:2156: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 yymsgbuf[128]; data/jq-1.6/src/util.c:49:7: [2] (misc) fopen: 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). FILE *fopen(const char *fname, const char *mode) { data/jq-1.6/src/util.c:50:33: [2] (buffer) MultiByteToWideChar: Requires maximum length in CHARACTERS, not bytes (CWE-120). size_t sz = sizeof(wchar_t) * MultiByteToWideChar(CP_UTF8, 0, fname, -1, NULL, 0); data/jq-1.6/src/util.c:52:3: [2] (buffer) MultiByteToWideChar: Requires maximum length in CHARACTERS, not bytes (CWE-120). MultiByteToWideChar(CP_UTF8, 0, fname, -1, wfname, sz); data/jq-1.6/src/util.c:54:26: [2] (buffer) MultiByteToWideChar: Requires maximum length in CHARACTERS, not bytes (CWE-120). sz = sizeof(wchar_t) * MultiByteToWideChar(CP_UTF8, 0, mode, -1, NULL, 0); data/jq-1.6/src/util.c:56:3: [2] (buffer) MultiByteToWideChar: Requires maximum length in CHARACTERS, not bytes (CWE-120). MultiByteToWideChar(CP_UTF8, 0, mode, -1, wmode, sz); data/jq-1.6/src/util.c:62:5: [2] (tmpfile) mkstemp: Potential for temporary file vulnerability in some circumstances. Some older Unix-like systems create temp files with permission to write by all by default, so be sure to set the umask to override this. Also, some older Unix systems might fail to use O_EXCL when opening the file, so make sure that O_EXCL is used by the library (CWE-377). int mkstemp(char *template) { data/jq-1.6/src/util.c:76:10: [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). fd = open(template, O_CREAT | O_EXCL | O_RDWR, 0600); data/jq-1.6/src/util.c:195: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[4096]; data/jq-1.6/src/util.c:297:32: [2] (misc) fopen: 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). state->current_input = fopen(f, "r"); data/jq-1.6/src/util.h:17:5: [2] (tmpfile) mkstemp: Potential for temporary file vulnerability in some circumstances. Some older Unix-like systems create temp files with permission to write by all by default, so be sure to set the umask to override this. Also, some older Unix systems might fail to use O_EXCL when opening the file, so make sure that O_EXCL is used by the library (CWE-377). int mkstemp(char *template); data/jq-1.6/src/builtin.c:492: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). p += strlen(p); data/jq-1.6/src/builtin.c:1488:20: [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). size_t alloced = strlen(fmt) + 100; data/jq-1.6/src/builtin.c:1518:20: [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). size_t alloced = strlen(fmt) + 100; data/jq-1.6/src/builtin.c:1749:45: [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). src = locfile_init(jq, "<builtin>", code, strlen(code)); data/jq-1.6/src/compile.c:386:42: [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 matchlen = (libname == NULL) ? 0 : strlen(libname); data/jq-1.6/src/compile.c:398:32: [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). char* tname = jv_mem_alloc(strlen(curr->symbol)+matchlen+1); data/jq-1.6/src/execute.c:1158:52: [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). locations = locfile_init(jq, "<top-level>", str, strlen(str)); data/jq-1.6/src/jq_test.c:82:14: [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 (prog[strlen(prog)-1] == '\n') prog[strlen(prog)-1] = 0; data/jq-1.6/src/jq_test.c:82:44: [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 (prog[strlen(prog)-1] == '\n') prog[strlen(prog)-1] = 0; data/jq-1.6/src/jq_test.c:92:15: [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 (buf[strlen(buf)-1] == '\n') buf[strlen(buf)-1] = 0; data/jq-1.6/src/jq_test.c:92:43: [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 (buf[strlen(buf)-1] == '\n') buf[strlen(buf)-1] = 0; data/jq-1.6/src/jq_test.c:298:62: [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). assert(jv_string_length_bytes(jv_copy(shortstr)) == (int)strlen(nasty)); data/jq-1.6/src/jv.c:630:31: [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). return jv_string_sized(str, strlen(str)); data/jq-1.6/src/jv.c:823:39: [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). return jv_string_append_buf(a, str, strlen(str)); data/jq-1.6/src/jv_dtoa.c:1654:12: [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). MALLOC(strlen((CONST char*)s0) + 1))) { data/jq-1.6/src/jv_parse.c:857:33: [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). return jv_parse_sized(string, strlen(string)); data/jq-1.6/src/jv_print.c:57:15: [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). e = c + strlen(c); data/jq-1.6/src/jv_print.c:62:12: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). (void) strncpy(&color_bufs[i][2], c, e - c); data/jq-1.6/src/jv_print.c:63:52: [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 (strspn(&color_bufs[i][2], "0123456789;") < strlen(&color_bufs[i][2])) data/jq-1.6/src/jv_print.c:84: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). len = strlen(s); data/jq-1.6/src/jv_print.c:106:14: [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). put_buf(s, strlen(s), fout, strout, T); data/jq-1.6/src/jv_print.c:394:22: [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). const size_t len = strlen(p); data/jq-1.6/src/jv_print.c:395:3: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(outbuf, p, bufsize); data/jq-1.6/src/lexer.c:782:14: [1] (buffer) getc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). (c = getc( yyin )) != EOF && c != '\n'; ++n ) \ data/jq-1.6/src/lexer.c:1974:32: [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). return jq_yy_scan_bytes(yystr,strlen(yystr) ,yyscanner); data/jq-1.6/src/main.c:515:11: [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 (strlen(argv[i]) != short_opts + 1) { data/jq-1.6/src/parser.c:1651:21: [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). # define yystrlen strlen data/jq-1.6/src/util.c:63:16: [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). size_t len = strlen(template); data/jq-1.6/src/util.c:332:32: [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). state->buf_valid_len = strlen(state->buf); ANALYSIS SUMMARY: Hits = 98 Lines analyzed = 22819 in approximately 0.61 seconds (37247 lines/second) Physical Source Lines of Code (SLOC) = 18660 Hits@level = [0] 94 [1] 29 [2] 51 [3] 9 [4] 9 [5] 0 Hits@level+ = [0+] 192 [1+] 98 [2+] 69 [3+] 18 [4+] 9 [5+] 0 Hits/KSLOC@level+ = [0+] 10.2894 [1+] 5.25188 [2+] 3.69775 [3+] 0.96463 [4+] 0.482315 [5+] 0 Dot directories skipped = 2 (--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.