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/agrep-4.17/agrep.c Examining data/agrep-4.17/agrep.h Examining data/agrep-4.17/asearch1.c Examining data/agrep-4.17/asplit.c Examining data/agrep-4.17/bitap.c Examining data/agrep-4.17/checkfile.c Examining data/agrep-4.17/checkfile.h Examining data/agrep-4.17/checksg.c Examining data/agrep-4.17/compat.c Examining data/agrep-4.17/config.h Examining data/agrep-4.17/defs.h Examining data/agrep-4.17/delim.c Examining data/agrep-4.17/dummyfilters.c Examining data/agrep-4.17/dummysyscalls.c Examining data/agrep-4.17/follow.c Examining data/agrep-4.17/io.c Examining data/agrep-4.17/main.c Examining data/agrep-4.17/maskgen.c Examining data/agrep-4.17/newmgrep.c Examining data/agrep-4.17/parse.c Examining data/agrep-4.17/preprocess.c Examining data/agrep-4.17/putils.c Examining data/agrep-4.17/re.h Examining data/agrep-4.17/recursive.c Examining data/agrep-4.17/utilities.c Examining data/agrep-4.17/autoconf.h Examining data/agrep-4.17/asearch.c Examining data/agrep-4.17/sgrep.c FINAL RESULTS: data/agrep-4.17/agrep.c:147:2: [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, ctime(&thetime)); /* of the form: Sun Sep 16 01:03:52 1973\n\0 */ data/agrep-4.17/agrep.c:149:2: [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. sscanf(s, "%s%s%s%s%s", s1, s2, s3, s4, s5); data/agrep-4.17/agrep.c:150:2: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(buffer, ": %s %s %s", s2, s3, s5); /* ditch Sun 01:03:52 */ data/agrep-4.17/agrep.c:209:9: [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(D_pattern, original_D_pattern); data/agrep-4.17/agrep.c:211:9: [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(old_D_pat, original_old_D_pat); data/agrep-4.17/agrep.c:2634:6: [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(D_pattern+1, argv[0]); data/agrep-4.17/agrep.c:2651:6: [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(D_pattern+1, p + 1); data/agrep-4.17/agrep.c:2659: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(original_D_pattern, D_pattern); data/agrep-4.17/agrep.c:2675:6: [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(COMP_DIR, argv[0]); data/agrep-4.17/agrep.c:2679:6: [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(COMP_DIR, p+1); data/agrep-4.17/agrep.c:2697:7: [4] (buffer) strcat: Does not check for buffer overflows when concatenating to destination [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or snprintf (warning: strncat is easily misused). strcat(Pattern, (argv)[0]); data/agrep-4.17/agrep.c:2699:11: [4] (buffer) strcat: Does not check for buffer overflows when concatenating to destination [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or snprintf (warning: strncat is easily misused). else strcat(Pattern, argv[0]); data/agrep-4.17/agrep.c:2705:7: [4] (buffer) strcat: Does not check for buffer overflows when concatenating to destination [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or snprintf (warning: strncat is easily misused). strcat(Pattern, p+1); data/agrep-4.17/agrep.c:2707:11: [4] (buffer) strcat: Does not check for buffer overflows when concatenating to destination [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or snprintf (warning: strncat is easily misused). else strcat (Pattern, p+1); data/agrep-4.17/agrep.c:2728:6: [4] (buffer) strcat: Does not check for buffer overflows when concatenating to destination [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or snprintf (warning: strncat is easily misused). strcat(Pattern, argv[0]); data/agrep-4.17/agrep.c:2748:6: [4] (buffer) strcat: Does not check for buffer overflows when concatenating to destination [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or snprintf (warning: strncat is easily misused). strcat (Pattern, p+1); data/agrep-4.17/agrep.c:2800: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(PAT_FILE_NAME, argv[0]); data/agrep-4.17/agrep.c:2851:6: [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(multibuf, argv[0]); data/agrep-4.17/agrep.c:3019:2: [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(FREQ_FILE, COMP_DIR); data/agrep-4.17/agrep.c:3021:2: [4] (buffer) strcat: Does not check for buffer overflows when concatenating to destination [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or snprintf (warning: strncat is easily misused). strcat(FREQ_FILE, DEF_FREQ_FILE); data/agrep-4.17/agrep.c:3022:2: [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(HASH_FILE, COMP_DIR); data/agrep-4.17/agrep.c:3024:2: [4] (buffer) strcat: Does not check for buffer overflows when concatenating to destination [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or snprintf (warning: strncat is easily misused). strcat(HASH_FILE, DEF_HASH_FILE); data/agrep-4.17/agrep.c:3025:2: [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(STRING_FILE, COMP_DIR); data/agrep-4.17/agrep.c:3027:2: [4] (buffer) strcat: Does not check for buffer overflows when concatenating to destination [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or snprintf (warning: strncat is easily misused). strcat(STRING_FILE, DEF_STRING_FILE); data/agrep-4.17/agrep.c:3053: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(Pattern, *argv); data/agrep-4.17/agrep.c:3095: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(Textfiles[Numfiles++], *argv++); data/agrep-4.17/agrep.c:3272: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(Textfiles[Numfiles++], *((char **)input)); data/agrep-4.17/agrep.c:3291: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(OldPattern, Pattern); data/agrep-4.17/agrep.c:3295: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(old_D_pat, D_pattern); data/agrep-4.17/agrep.c:3305:6: [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(tc_D_pattern, D_pattern); data/agrep-4.17/agrep.c:3513:10: [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). else strcpy(CurrentFileName, file_list[i]); data/agrep-4.17/agrep.c:3722: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(old_D_pat, D_pattern); data/agrep-4.17/agrep.c:3732:11: [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). else strcpy(CurrentFileName, file_list[i]); data/agrep-4.17/agrep.c:3784:11: [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). else strcpy(CurrentFileName, file_list[i]); data/agrep-4.17/asplit.c:254: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(n->data.leaf.value, oldtokenbuf); data/agrep-4.17/asplit.c:380: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(&pat_buf[*pat_ptr], aterminals[first].data.leaf.value); data/agrep-4.17/delim.c:15:2: [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(temp, src); data/agrep-4.17/dummysyscalls.c:42:2: [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(temp, name); data/agrep-4.17/follow.c:30:16: [4] (buffer) strcat: Does not check for buffer overflows when concatenating to destination [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or snprintf (warning: strncat is easily misused). return strcat(strcat(strcpy(s1, ".*("), s), ")"); data/agrep-4.17/preprocess.c:98: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(tc_D_pattern, D_pattern); data/agrep-4.17/preprocess.c:114:2: [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(temp, D_pattern); data/agrep-4.17/preprocess.c:121:3: [4] (buffer) strcat: Does not check for buffer overflows when concatenating to destination [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or snprintf (warning: strncat is easily misused). strcat(temp, Pattern); data/agrep-4.17/preprocess.c:135:3: [4] (buffer) strcat: Does not check for buffer overflows when concatenating to destination [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or snprintf (warning: strncat is easily misused). strcat(temp, Pattern); data/agrep-4.17/preprocess.c:186:2: [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(D_pattern, old_D_pat); data/agrep-4.17/preprocess.c:341: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(old_pat, Pattern); /* do real change to the Pattern to be returned */ data/agrep-4.17/recursive.c:67: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(name_buf, argv[i]); data/agrep-4.17/recursive.c:125: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(file_list[fdx++], name); data/agrep-4.17/recursive.c:165: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(nbp, dp->d_name); data/agrep-4.17/agrep.c:3012:23: [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 ((home = (char *)getenv("HOME")) == NULL) { data/agrep-4.17/config.h:9:26: [3] (buffer) getwd: This does not protect against buffer overflows by itself, so use with caution (CWE-120, CWE-20). Use getcwd instead. #define getcwd(buf,size) getwd(buf) /* NB: unchecked target size--could overflow; BG: Ok since buffers are usually >= 256B */ data/agrep-4.17/agrep.c:65: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 PAT_FILE_NAME[MAX_LINE_LEN]; data/agrep-4.17/agrep.c:88: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 amatched_terminals[MAXNUM_PAT]; data/agrep-4.17/agrep.c:89: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 aduplicates[MAXNUM_PAT][MAXNUM_PAT]; /* tells what other patterns are exactly equal to the i-th one */ data/agrep-4.17/agrep.c:90: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 tc_aduplicates[MAXNUM_PAT][MAXNUM_PAT]; /* tells what other patterns are exactly equal to the i-th one */ data/agrep-4.17/agrep.c:115: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 COMP_DIR[MAX_LINE_LEN]; data/agrep-4.17/agrep.c:116: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 FREQ_FILE[MAX_LINE_LEN], HASH_FILE[MAX_LINE_LEN], STRING_FILE[MAX_LINE_LEN]; /* interfacing with tcompress */ data/agrep-4.17/agrep.c:144: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 s[256], s1[16], s2[16], s3[16], s4[16], s5[16]; data/agrep-4.17/agrep.c:145: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. static char buffer[256]; data/agrep-4.17/agrep.c:152: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. static char buffer[256]; data/agrep-4.17/agrep.c:2355: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 s[32]; data/agrep-4.17/agrep.c:2358:4: [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(s, "%d: ", j-1); data/agrep-4.17/agrep.c:2376: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 s[32]; data/agrep-4.17/agrep.c:2378:4: [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(s, "%d= ", CurrentByteOffset); data/agrep-4.17/agrep.c:2399: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 s[32]; data/agrep-4.17/agrep.c:2401:4: [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(s, "@%d{%d} ", CurrentByteOffset - (i-bp), i-bp); data/agrep-4.17/agrep.c:2655:5: [2] (buffer) strcat: Does not check for buffer overflows when concatenating to destination [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or snprintf (warning: strncat is easily misused). Risk is low because the source is a constant string. strcat(D_pattern, ">; "); data/agrep-4.17/agrep.c:2789:19: [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((multifd = open(argv[0], O_RDONLY)) < 0) { data/agrep-4.17/agrep.c:2949:9: [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). I = atoi(p + 1); /* Insertion Cost */ data/agrep-4.17/agrep.c:2955:9: [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). S = atoi(p + 1); /* Substitution Cost */ data/agrep-4.17/agrep.c:2961:10: [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). DD = atoi(p + 1); /* Deletion Cost */ data/agrep-4.17/agrep.c:2988:10: [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). D = atoi(p); data/agrep-4.17/agrep.c:3105:20: [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. if (( ((unsigned char *)Pattern)[i] > USERRANGE_MIN) && ( ((unsigned char *)Pattern)[i] <= USERRANGE_MAX)) { data/agrep-4.17/agrep.c:3105:72: [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. if (( ((unsigned char *)Pattern)[i] > USERRANGE_MIN) && ( ((unsigned char *)Pattern)[i] <= USERRANGE_MAX)) { data/agrep-4.17/agrep.c:3196: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(agrep_saved_pattern, pattern_buffer, pattern_len); data/agrep-4.17/agrep.c:3439: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 c[8]; data/agrep-4.17/agrep.c:3467:6: [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 s[32]; data/agrep-4.17/agrep.c:3470:6: [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(s, "%d\n", total_line-(num_of_matched - prev_num_of_matched)); data/agrep-4.17/agrep.c:3487:6: [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 s[32]; data/agrep-4.17/agrep.c:3490:6: [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(s, "%d\n", (num_of_matched - prev_num_of_matched)); data/agrep-4.17/agrep.c:3512:26: [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. if (PRINTFILENUMBER) sprintf(CurrentFileName, "%d", i); data/agrep-4.17/agrep.c:3580: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 s[32]; data/agrep-4.17/agrep.c:3582:9: [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(s, ": %d\n", total_line - (num_of_matched - prev_num_of_matched)); data/agrep-4.17/agrep.c:3601: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 s[32]; data/agrep-4.17/agrep.c:3604:9: [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(s, "%d\n", total_line - (num_of_matched - prev_num_of_matched)); data/agrep-4.17/agrep.c:3659: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 s[32]; data/agrep-4.17/agrep.c:3661:9: [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(s, ": %d\n", (num_of_matched - prev_num_of_matched)); data/agrep-4.17/agrep.c:3680: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 s[32]; data/agrep-4.17/agrep.c:3683:9: [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(s, "%d\n", (num_of_matched - prev_num_of_matched)); data/agrep-4.17/agrep.c:3731:27: [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. if (PRINTFILENUMBER) sprintf(CurrentFileName, "%d", i); data/agrep-4.17/agrep.c:3783:27: [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. if (PRINTFILENUMBER) sprintf(CurrentFileName, "%d", i); data/agrep-4.17/agrep.c:3986: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 s[32]; data/agrep-4.17/agrep.c:3989:4: [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(s, "%d: ", j-1); data/agrep-4.17/agrep.c:4006: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 s[32]; data/agrep-4.17/agrep.c:4008:4: [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(s, "%d= ", CurrentByteOffset-1); data/agrep-4.17/agrep.c:4029: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 s[32]; data/agrep-4.17/agrep.c:4031:4: [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(s, "@%d{%d}\n", CurrentByteOffset - (i2-i1), i2-i1); data/agrep-4.17/asplit.c:98: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(terminals[*pnum_terminals].data.leaf.value, buffer, buffer_pat - buffer); /* without distinguishing delimiter */ data/agrep-4.17/asplit.c:182:4: [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(n->data.leaf.value, tokenbuf, tokenlen); data/agrep-4.17/asplit.c:233: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(oldtokenbuf, tokenbuf, tokenlen); data/agrep-4.17/bitap.c:553: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(buf, agrep_inbuffer + agrep_inpointer, total_read); data/agrep-4.17/checkfile.c:29:10: [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 ibuf[MAXLINE]; data/agrep-4.17/compat.c:16: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. extern char Progname[MAXNAME]; data/agrep-4.17/dummysyscalls.c:9:9: [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). return open(name, flags, mode); data/agrep-4.17/dummysyscalls.c:17:9: [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). return fopen(name, flags); data/agrep-4.17/follow.c:30:23: [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. return strcat(strcat(strcpy(s1, ".*("), s), ")"); data/agrep-4.17/io.c:32: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(buf, agrep_inbuffer + agrep_inpointer, total_read); data/agrep-4.17/main.c:12: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. extern char Pattern[MAXPAT]; data/agrep-4.17/maskgen.c:20:12: [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 class[WORD]; data/agrep-4.17/newmgrep.c:40: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. extern char aduplicates[MAXNUM_PAT][MAXNUM_PAT]; /* tells what other patterns are exactly equal to the i-th one */ data/agrep-4.17/newmgrep.c:41: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. extern char tc_aduplicates[MAXNUM_PAT][MAXNUM_PAT]; /* tells what other patterns are exactly equal to the i-th one */ data/agrep-4.17/newmgrep.c:77: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. extern char FREQ_FILE[MAX_LINE_LEN], HASH_FILE[MAX_LINE_LEN], STRING_FILE[MAX_LINE_LEN]; data/agrep-4.17/newmgrep.c:78: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. extern char PAT_FILE_NAME[MAX_LINE_LEN]; data/agrep-4.17/newmgrep.c:97: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. extern char amatched_terminals[MAXNUM_PAT]; /* which patterns have been matched in the current line? Used only with AParse != 0, so max_num is not needed */ data/agrep-4.17/newmgrep.c:358: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. unsigned char tc_buf[MAXPAT * 2]; /* maximum length of the compressed pattern */ data/agrep-4.17/newmgrep.c:378:4: [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(tc_patt[p], tc_buf, tc_length); data/agrep-4.17/newmgrep.c:472: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(text+start-D_length, D_pattern, D_length); data/agrep-4.17/newmgrep.c:556:26: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. if (start > D_length) memcpy(text+start-D_length, D_pattern, D_length); data/agrep-4.17/newmgrep.c:557:4: [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(text+start+residue, D_pattern, D_length); data/agrep-4.17/newmgrep.c:807: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 s[32]; data/agrep-4.17/newmgrep.c:809:4: [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(s, "%d- ", pat_index); data/agrep-4.17/newmgrep.c:827: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 s[32]; data/agrep-4.17/newmgrep.c:829:4: [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(s, "%d= ", CurrentByteOffset); data/agrep-4.17/newmgrep.c:847: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 s[32]; data/agrep-4.17/newmgrep.c:849:4: [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(s, "@%d{%d} ", CurrentByteOffset - (text -curtextbegin), curtextend-curtextbegin); data/agrep-4.17/newmgrep.c:998:10: [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(agrep_outbuffer + agrep_outpointer, curtextbegin, curtextend-curtextbegin);\ data/agrep-4.17/newmgrep.c:1028:9: [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(agrep_outbuffer+agrep_outpointer, lastout, curtextbegin-lastout);\ data/agrep-4.17/newmgrep.c:1107:25: [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(agrep_outbuffer+agrep_outpointer, lastout, textend-lastout+1); data/agrep-4.17/newmgrep.c:1496:9: [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(agrep_outbuffer + agrep_outpointer, curtextbegin, curtextend-curtextbegin);\ data/agrep-4.17/newmgrep.c:1526:8: [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(agrep_outbuffer+agrep_outpointer, lastout, curtextbegin-lastout);\ data/agrep-4.17/newmgrep.c:1590:25: [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(agrep_outbuffer+agrep_outpointer, lastout, text-lastout+1); data/agrep-4.17/newmgrep.c:1992: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 aduplicates[MAXNUM_PAT][MAXNUM_PAT]; data/agrep-4.17/newmgrep.c:1995: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 tr[256]; data/agrep-4.17/preprocess.c:36: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. extern char FREQ_FILE[MAX_LINE_LEN], HASH_FILE[MAX_LINE_LEN], STRING_FILE[MAX_LINE_LEN]; /* interfacing with tcompress */ data/agrep-4.17/recursive.c:49: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 *file_list[max_list*2]; data/agrep-4.17/recursive.c:52: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 name_buf[BUFSIZE]; data/agrep-4.17/sgrep.c:43: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. extern unsigned char D_pattern[MaxDelimit *2], tc_D_pattern[MaxDelimit *2]; data/agrep-4.17/sgrep.c:71: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. extern char FREQ_FILE[MAX_LINE_LEN], HASH_FILE[MAX_LINE_LEN], STRING_FILE[MAX_LINE_LEN]; data/agrep-4.17/sgrep.c:81:10: [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 char_map[MAXSYM]; data/agrep-4.17/sgrep.c:89: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 MEMBER_1[MAXMEMBER_1]; data/agrep-4.17/sgrep.c:144: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. unsigned char temp[MAXPATT]; data/agrep-4.17/sgrep.c:162: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(temp, pat, *m); data/agrep-4.17/sgrep.c:164: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(pat+1, temp, *m); data/agrep-4.17/sgrep.c:286:33: [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(text+start-D_length, D_pattern, D_length); data/agrep-4.17/sgrep.c:384:4: [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(text+start, text+end, residue); data/agrep-4.17/sgrep.c:397:47: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. if (start > D_length) memcpy(text+start-D_length, D_pattern, D_length); data/agrep-4.17/sgrep.c:398:25: [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(text+start+residue, D_pattern, D_length); data/agrep-4.17/sgrep.c:531: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(tempbuf, text+end+1, m); /* save portion being overwritten */ data/agrep-4.17/sgrep.c:551:7: [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(text+end+1, tempbuf, m); /* restore */ data/agrep-4.17/sgrep.c:559:7: [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(text+end+1, tempbuf, m); /* restore */ data/agrep-4.17/sgrep.c:569:7: [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(text+end+1, tempbuf, m); /* restore */ data/agrep-4.17/sgrep.c:578:8: [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(text+end+1, tempbuf, m); /* restore */ data/agrep-4.17/sgrep.c:586:8: [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(text+end+1, tempbuf, m); /* restore */ data/agrep-4.17/sgrep.c:642: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(text+end+1, tempbuf, m); /* restore */ data/agrep-4.17/sgrep.c:817: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. char s[32]; data/agrep-4.17/sgrep.c:819:8: [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(s, "%d=", CurrentByteOffset); data/agrep-4.17/sgrep.c:837: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. char s[32]; data/agrep-4.17/sgrep.c:839:8: [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(s, "@%d{%d} ", CurrentByteOffset - (text -curtextbegin), curtextend-curtextbegin); data/agrep-4.17/sgrep.c:887:8: [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(agrep_outbuffer+agrep_outpointer, curtextbegin, curtextend-curtextbegin); data/agrep-4.17/sgrep.c:924:8: [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(agrep_outbuffer+agrep_outpointer, lastout, curtextbegin-lastout); data/agrep-4.17/sgrep.c:970: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(agrep_outbuffer+agrep_outpointer, lastout, textend-lastout + 1); data/agrep-4.17/sgrep.c:1225: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(agrep_outbuffer+agrep_outpointer, lastout, textend-lastout + 1); data/agrep-4.17/sgrep.c:1322: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(agrep_outbuffer+agrep_outpointer, *lastout, curtextbegin-*lastout); data/agrep-4.17/sgrep.c:1395: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 s[32]; data/agrep-4.17/sgrep.c:1397:4: [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(s, "%d= ", CurrentByteOffset); data/agrep-4.17/sgrep.c:1415: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 s[32]; data/agrep-4.17/sgrep.c:1417:4: [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(s, "@%d{%d} ", CurrentByteOffset - (text + oldi-curtextbegin), curtextend-curtextbegin); data/agrep-4.17/sgrep.c:1462:4: [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(agrep_outbuffer + agrep_outpointer, curtextbegin, curtextend - curtextbegin); data/agrep-4.17/sgrep.c:1676: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. char s[32]; data/agrep-4.17/sgrep.c:1678:8: [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(s, "%d= ", CurrentByteOffset); data/agrep-4.17/sgrep.c:1696: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. char s[32]; data/agrep-4.17/sgrep.c:1698:8: [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(s, "@%d{%d} ", CurrentByteOffset - (text -curtextbegin), curtextend-curtextbegin); data/agrep-4.17/sgrep.c:1745:8: [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(agrep_outbuffer+agrep_outpointer, curtextbegin, curtextend-curtextbegin); data/agrep-4.17/sgrep.c:1782:8: [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(agrep_outbuffer+agrep_outpointer, lastout, curtextbegin-lastout); data/agrep-4.17/sgrep.c:1830: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(agrep_outbuffer+agrep_outpointer, lastout, textend-lastout + 1); data/agrep-4.17/sgrep.c:1970: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 s[32]; data/agrep-4.17/sgrep.c:1972:9: [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(s, "%d= ", CurrentByteOffset); data/agrep-4.17/sgrep.c:1990: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 s[32]; data/agrep-4.17/sgrep.c:1992:9: [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(s, "@%d{%d} ", CurrentByteOffset - (text -curtextbegin), curtextend-curtextbegin); data/agrep-4.17/sgrep.c:2039:9: [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(agrep_outbuffer+agrep_outpointer, curtextbegin, curtextend-curtextbegin); data/agrep-4.17/sgrep.c:2076:9: [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(agrep_outbuffer+agrep_outpointer, lastout, curtextbegin-lastout); data/agrep-4.17/sgrep.c:2123: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(agrep_outbuffer+agrep_outpointer, lastout, textend-lastout + 1); data/agrep-4.17/sgrep.c:2378: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 s[32]; data/agrep-4.17/sgrep.c:2380:9: [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(s, "%d= ", CurrentByteOffset); data/agrep-4.17/sgrep.c:2398: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 s[32]; data/agrep-4.17/sgrep.c:2400:9: [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(s, "@%d{%d} ", CurrentByteOffset - (text -curtextbegin), curtextend-curtextbegin); data/agrep-4.17/sgrep.c:2447:9: [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(agrep_outbuffer+agrep_outpointer, curtextbegin, curtextend-curtextbegin); data/agrep-4.17/sgrep.c:2484:9: [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(agrep_outbuffer+agrep_outpointer, lastout, curtextbegin-lastout); data/agrep-4.17/sgrep.c:2528: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(agrep_outbuffer+agrep_outpointer, lastout, textend-lastout + 1); data/agrep-4.17/agrep.c:148:4: [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). s[strlen(s) - 1] = '\0'; data/agrep-4.17/agrep.c:264:2: [1] (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 character. strcpy(tc_D_pattern, "\n"); data/agrep-4.17/agrep.c:615:4: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(buffer, buffer+num_read, Maxline); data/agrep-4.17/agrep.c:1106:4: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(buffer, buffer+num_read, Maxline); data/agrep-4.17/agrep.c:1624:4: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(buffer+Maxline-ResidueSize, buffer+lasti, ResidueSize); data/agrep-4.17/agrep.c:2045:4: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(buffer, buffer+num_read, Maxline); data/agrep-4.17/agrep.c:2464:2: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(Progname, argv[0], MAXNAME); data/agrep-4.17/agrep.c:2625: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). if ((D_length = strlen(argv[0])) > MaxDelimit) { data/agrep-4.17/agrep.c:2642: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). if ((D_length = strlen(p + 1)) > MaxDelimit) { data/agrep-4.17/agrep.c:2842: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 ((argv[0] == NULL) || ((multilen = strlen(argv[0])) <= 0)) { data/agrep-4.17/agrep.c:3016:8: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). else strncpy(COMP_DIR, home, MAX_LINE_LEN); data/agrep-4.17/agrep.c:3020:2: [1] (buffer) strcat: Does not check for buffer overflows when concatenating to destination [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or snprintf (warning: strncat is easily misused). Risk is low because the source is a constant character. strcat(FREQ_FILE, "/"); data/agrep-4.17/agrep.c:3023:2: [1] (buffer) strcat: Does not check for buffer overflows when concatenating to destination [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or snprintf (warning: strncat is easily misused). Risk is low because the source is a constant character. strcat(HASH_FILE, "/"); data/agrep-4.17/agrep.c:3026:2: [1] (buffer) strcat: Does not check for buffer overflows when concatenating to destination [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or snprintf (warning: strncat is easily misused). Risk is low because the source is a constant character. strcat(STRING_FILE, "/"); data/agrep-4.17/agrep.c:3087:49: [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 (!(Textfiles[Numfiles] = (CHAR *)malloc((strlen(*argv)+2)))) { data/agrep-4.17/agrep.c:3102:6: [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). M = strlen(Pattern); data/agrep-4.17/agrep.c:3127:3: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(pattern_buffer, Pattern, M+1); /* copy \0 */ data/agrep-4.17/agrep.c:3206:4: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(Pattern, pattern_buffer, pattern_len+1); /* copy \0 */ data/agrep-4.17/agrep.c:3207:7: [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). M = strlen(Pattern); data/agrep-4.17/agrep.c:3264:49: [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 (!(Textfiles[Numfiles] = (CHAR *)malloc((strlen(*(char **)input)+2)))) { data/agrep-4.17/agrep.c:3310:8: [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). M = strlen(OldPattern); data/agrep-4.17/agrep.c:3458:38: [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(SGREP) ret = sgrep(OldPattern, strlen(OldPattern), fd, D, 0); data/agrep-4.17/agrep.c:3519:48: [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 (!tuncompressible_filename(file_list[i], strlen(file_list[i]))) TCOMPRESSED = OFF; data/agrep-4.17/agrep.c:3528:40: [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(SGREP) ret = sgrep(OldPattern, strlen(OldPattern), fd, D, i); data/agrep-4.17/agrep.c:3738:41: [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(SGREP) ret = sgrep(OldPattern,strlen(OldPattern),fd,D, i); data/agrep-4.17/agrep.c:3790:41: [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(SGREP) ret = sgrep(OldPattern,strlen(OldPattern),fd,D, i); data/agrep-4.17/agrep.c:3842:9: [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(fname); data/agrep-4.17/asearch.c:50: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). D_length = strlen(old_D_pat); data/agrep-4.17/asearch.c:84:5: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(buffer+end, old_D_pat, D_length); data/agrep-4.17/asearch.c:360:5: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(buffer+Max_record-ResidueSize, buffer+lasti, ResidueSize); data/agrep-4.17/asearch.c:679: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). D_length = strlen(old_D_pat); data/agrep-4.17/asearch.c:705:5: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(buffer+end, old_D_pat, D_length); data/agrep-4.17/asearch.c:924:5: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(buffer+Max_record-ResidueSize, buffer+lasti, ResidueSize); data/agrep-4.17/asearch1.c:42: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). D_length = strlen(old_D_pat); data/agrep-4.17/asearch1.c:77:5: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(buffer+Max_record+num_read, old_D_pat, D_length); data/agrep-4.17/asearch1.c:287:4: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(buffer+Max_record-ResidueSize, buffer+lasti, ResidueSize); data/agrep-4.17/asplit.c:376: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). word_length = strlen(aterminals[first].data.leaf.value); data/agrep-4.17/bitap.c:57: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). D_length = strlen(old_D_pat); data/agrep-4.17/bitap.c:122:5: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(buffer+Max_record+num_read, old_D_pat, D_length); data/agrep-4.17/bitap.c:297:4: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(buffer+Max_record-ResidueSize, buffer+lasti, ResidueSize); data/agrep-4.17/bitap.c:520:15: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). num_read = read(fd, buf+total_read, record_size - total_read); data/agrep-4.17/checksg.c:24:6: [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). m = strlen(Pattern); data/agrep-4.17/delim.c:27: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). *pdestlen = strlen(dest); data/agrep-4.17/follow.c:29: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). s1 = malloc((unsigned) strlen(s)+4+1); data/agrep-4.17/follow.c:30:9: [1] (buffer) strcat: Does not check for buffer overflows when concatenating to destination [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or snprintf (warning: strncat is easily misused). Risk is low because the source is a constant character. return strcat(strcat(strcpy(s1, ".*("), s), ")"); data/agrep-4.17/io.c:18:15: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). num_read = read(fd, buf+total_read, record_size - total_read); data/agrep-4.17/maskgen.c:28:53: [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). fprintf(stderr, "maskgen: len=%d, pat=%s, D=%d\n", strlen(Pattern), Pattern, D); data/agrep-4.17/maskgen.c:34: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 ((M = strlen(Pattern)) <= 0) return 0; data/agrep-4.17/newmgrep.c:287:7: [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(patt[i]); data/agrep-4.17/newmgrep.c:377:70: [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 ((tc_length = quick_tcompress(FREQ_FILE, HASH_FILE, tc_patt[p], strlen(tc_patt[p]), tc_buf, MAXPAT * 2 - 8, TC_EASYSEARCH)) > 0) { data/agrep-4.17/newmgrep.c:393:7: [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(tc_patt[i]); data/agrep-4.17/newmgrep.c:543:4: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(text+start, text+end, residue); data/agrep-4.17/newmgrep.c:2001: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). leni = strlen(aterminals[i].data.leaf.value); data/agrep-4.17/newmgrep.c:2007: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). lenj = strlen(aterminals[j].data.leaf.value); data/agrep-4.17/preprocess.c:51:76: [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). fprintf(stderr, "preprocess: m=%d, pat=%s, PAT_FILE=%d, PAT_BUFFER=%d\n", strlen(Pattern), Pattern, PAT_FILE, PAT_BUFFER); data/agrep-4.17/preprocess.c:53: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 ((m = strlen(Pattern)) <= 0) return 0; data/agrep-4.17/preprocess.c:80:7: [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). m = strlen(Pattern); data/agrep-4.17/preprocess.c:113:26: [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). r_pat = (CHAR *) malloc(strlen(Pattern)+2*strlen(D_pattern) + 8); /* bug-report, From: Chris Dalton <crd@hplb.hpl.hp.com> */ data/agrep-4.17/preprocess.c:113: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). r_pat = (CHAR *) malloc(strlen(Pattern)+2*strlen(D_pattern) + 8); /* bug-report, From: Chris Dalton <crd@hplb.hpl.hp.com> */ data/agrep-4.17/preprocess.c:115: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). d_end = t = strlen(temp); /* size of D_pattern, including '; ' */ data/agrep-4.17/preprocess.c:122:7: [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). m = strlen(temp); data/agrep-4.17/preprocess.c:136:7: [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). m = strlen(temp); data/agrep-4.17/recursive.c:20: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). # define NAMLEN(dirent) strlen((dirent)->d_name) data/agrep-4.17/recursive.c:147: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). nbp = name + strlen(name); data/agrep-4.17/sgrep.c:193:2: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(pat, in_pat, MAXLINE); data/agrep-4.17/sgrep.c:2137:6: [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). m = strlen(Pattern); data/agrep-4.17/sgrep.c:2219:6: [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). m = strlen(Pattern); ANALYSIS SUMMARY: Hits = 255 Lines analyzed = 14502 in approximately 0.39 seconds (37097 lines/second) Physical Source Lines of Code (SLOC) = 12541 Hits@level = [0] 372 [1] 67 [2] 138 [3] 2 [4] 48 [5] 0 Hits@level+ = [0+] 627 [1+] 255 [2+] 188 [3+] 50 [4+] 48 [5+] 0 Hits/KSLOC@level+ = [0+] 49.996 [1+] 20.3333 [2+] 14.9908 [3+] 3.98692 [4+] 3.82745 [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.