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/c2esp-27/src/c2esp.c Examining data/c2esp-27/src/c2espC.c Examining data/c2esp-27/src/command2esp.c Examining data/c2esp-27/src/c2espcommon.c Examining data/c2esp-27/src/c2espcommon.h FINAL RESULTS: data/c2esp-27/src/c2esp.c:670:3: [5] (race) chmod: This accepts filename arguments; if an attacker can move those files, a race condition results. (CWE-362). Use fchmod( ) instead. chmod(Fname, S_IRUSR | S_IWUSR | S_IROTH ); //let anyone read it data/c2esp-27/src/c2espC.c:424:2: [5] (race) chmod: This accepts filename arguments; if an attacker can move those files, a race condition results. (CWE-362). Use fchmod( ) instead. chmod("/tmp/KodakPrintFile", S_IRUSR | S_IWUSR | S_IROTH ); //let anyone read it data/c2esp-27/src/c2espC.c:486:4: [5] (race) chmod: This accepts filename arguments; if an attacker can move those files, a race condition results. (CWE-362). Use fchmod( ) instead. chmod(RasFileName, S_IRUSR | S_IWUSR | S_IROTH ); //let anyone read it data/c2esp-27/src/c2espC.c:487:4: [5] (race) chmod: This accepts filename arguments; if an attacker can move those files, a race condition results. (CWE-362). Use fchmod( ) instead. chmod("/tmp/KodakUncompressed", S_IRUSR | S_IWUSR | S_IROTH ); //let anyone read it data/c2esp-27/src/c2espC.c:742:3: [5] (race) chmod: This accepts filename arguments; if an attacker can move those files, a race condition results. (CWE-362). Use fchmod( ) instead. chmod("/tmp/KodakCompPage", S_IRUSR | S_IWUSR | S_IROTH ); //let anyone read it data/c2esp-27/src/c2espC.c:743:3: [5] (race) chmod: This accepts filename arguments; if an attacker can move those files, a race condition results. (CWE-362). Use fchmod( ) instead. chmod("/tmp/KodakPrintLog", S_IRUSR | S_IWUSR | S_IROTH ); //let anyone read it data/c2esp-27/src/c2espC.c:744:3: [5] (race) chmod: This accepts filename arguments; if an attacker can move those files, a race condition results. (CWE-362). Use fchmod( ) instead. chmod("/tmp/KodakPrintFile", S_IRUSR | S_IWUSR | S_IROTH ); //let anyone read it data/c2esp-27/src/c2espcommon.c:75:3: [5] (race) chmod: This accepts filename arguments; if an attacker can move those files, a race condition results. (CWE-362). Use fchmod( ) instead. chmod(ExtLogFileName, S_IRUSR | S_IWUSR | S_IROTH ); //let anyone read it data/c2esp-27/src/c2esp.c:130:15: [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. if (OutFile) fprintf(OutFile, PrintFormat, I1, I2); //to the specified file data/c2esp-27/src/c2esp.c:132:2: [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. fprintf(stdout, PrintFormat, I1, I2); //and to the output data/c2esp-27/src/c2esp.c:704:7: [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. fprintf(stderr, ("ERROR: c2esp: No pages found!\n")); data/c2esp-27/src/c2esp.c:971:7: [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. fprintf(stderr, ("Usage: %s job-id user title copies options [file]\n"), "rastertoek"); data/c2esp-27/src/c2esp.c:1006:8: [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. fprintf(stderr, ("DEBUG: ================ %s ====================================\n"),Version); data/c2esp-27/src/c2esp.c:1025:10: [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. fprintf(stderr, ("ERROR: c2esp: Unable to open raster file - %s\n"), data/c2esp-27/src/c2espC.c:337:6: [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. fprintf(stderr, ("Usage: %s job-id user title copies options [file]\n"), "rastertoek"); data/c2esp-27/src/c2espC.c:369:2: [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. fprintf(stderr, ("DEBUG: ================= %s ===================================\n"),Version); data/c2esp-27/src/c2espC.c:392:7: [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. fprintf(stderr, ("ERROR: c2espC: Unable to open raster file - %s\n"), strerror(errno)); data/c2esp-27/src/c2espC.c:398:5: [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. fprintf(stderr, ("DEBUG: c2espC: opening raster\n")); data/c2esp-27/src/c2espcommon.c:68: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(CallerName,ExtCallerName); data/c2esp-27/src/c2espcommon.c:96: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(CupsFormat,CallerName); data/c2esp-27/src/c2espcommon.c:101:2: [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. fprintf(stderr, CupsFormat, time(NULL)-StartTime, I1, I2); data/c2esp-27/src/c2espcommon.c:102:23: [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. if (LogFile != NULL) fprintf(LogFile, CupsFormat, time(NULL)-StartTime, I1, I2); data/c2esp-27/src/c2espcommon.c:110: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(CupsFormat,CallerName); data/c2esp-27/src/c2espcommon.c:113:2: [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. fprintf(stderr, CupsFormat, time(NULL)-StartTime, String); data/c2esp-27/src/c2espcommon.c:114:23: [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. if (LogFile != NULL) fprintf(LogFile, CupsFormat, time(NULL)-StartTime, String); data/c2esp-27/src/c2espcommon.c:126:15: [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. if (OutFile) fprintf(OutFile, PrintFormat, I1, I2); //to the specified file data/c2esp-27/src/c2espcommon.c:132: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(LogFormat,PrintFormat); data/c2esp-27/src/c2espcommon.c:135:2: [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. fprintf(stdout, PrintFormat, I1, I2); //and to the output data/c2esp-27/src/c2esp.c:1040:39: [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. DoLogString("opening ppd %s\n",getenv("PPD")); data/c2esp-27/src/c2esp.c:1041:22: [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. ppd = ppdOpenFile(getenv("PPD")); data/c2esp-27/src/c2esp.c:1050:46: [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. else DoLogString("Problem opening ppd %s\n",getenv("PPD")); data/c2esp-27/src/c2esp.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 KodakPaperSize[50]; /* String that the printer expects for paper size */ data/c2esp-27/src/c2esp.c:657:11: [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). Handle = fopen(Name, "w"); data/c2esp-27/src/c2esp.c:1023:17: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). if ((fd = open(argv[6], O_RDONLY)) == -1) data/c2esp-27/src/c2esp.c:1073: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). JobFile = fopen(JobFileName, "w"); data/c2esp-27/src/c2esp.c:1077:14: [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). PrintFile = fopen(PrintFileName, "w"); data/c2esp-27/src/c2espC.c:66: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 KodakPaperSize[50]; /* String that the printer expects for paper size */ data/c2esp-27/src/c2espC.c:82: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 out[CHUNK]; /*buffer for a compressed line */ data/c2esp-27/src/c2espC.c:321: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 RasFileName[100]=""; data/c2esp-27/src/c2espC.c:390:13: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). if ((fd = open(argv[6], O_RDONLY)) == -1) data/c2esp-27/src/c2espC.c:422:14: [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). PrintFile = fopen("/tmp/KodakPrintFile", "w");//open the print file data/c2esp-27/src/c2espC.c:451:23: [2] (tmpfile) tmpfile: Function tmpfile() has a security flaw on some systems (e.g., older System V systems) (CWE-377). if ( !(CompData=tmpfile()) ) data/c2esp-27/src/c2espC.c:463:5: [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(RasFileName,"/tmp/RasForComp.ppm"); data/c2esp-27/src/c2espC.c:469:5: [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(RasFileName,"/tmp/RasForComp.pbm"); data/c2esp-27/src/c2espC.c:483:10: [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). dfp = fopen(RasFileName, "w"); data/c2esp-27/src/c2espC.c:484:23: [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). UncompressedFile = fopen("/tmp/KodakUncompressed", "w"); //open the file data/c2esp-27/src/c2espcommon.c:44: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 CallerName[50]; /* String that identifies the calling program */ data/c2esp-27/src/c2espcommon.c:46: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 BackBuf[32000]; //for the back channel replies from the printer data/c2esp-27/src/c2espcommon.c:73:13: [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). LogFile = fopen(ExtLogFileName, "w"); //open the log file data/c2esp-27/src/c2espcommon.c:94: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 CupsFormat[200]; data/c2esp-27/src/c2espcommon.c:95:2: [2] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). Risk is low because the source is a constant string. strcpy(CupsFormat, "DEBUG: "); data/c2esp-27/src/c2espcommon.c:97:2: [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(CupsFormat,":%d : "); data/c2esp-27/src/c2espcommon.c:108: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 CupsFormat[200]; data/c2esp-27/src/c2espcommon.c:109:2: [2] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). Risk is low because the source is a constant string. strcpy(CupsFormat, "DEBUG: "); data/c2esp-27/src/c2espcommon.c:111:2: [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(CupsFormat,":%d : "); data/c2esp-27/src/c2espcommon.c:122: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 Display[80]; data/c2esp-27/src/c2espcommon.c:123: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 LogFormat[200]; data/c2esp-27/src/c2espcommon.c:128:2: [2] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). Risk is low because the source is a constant string. strcpy(LogFormat, "-> "); data/c2esp-27/src/c2espcommon.c:130:2: [2] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). Risk is low because the source is a constant string. strcpy(LogFormat, "-block- "); data/c2esp-27/src/c2espcommon.c:161: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 BackBuf[2]; //useless buffer to satisfy cupsSideChannelDoRequest data/c2esp-27/src/c2espcommon.c:194: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 Display[80]; data/c2esp-27/src/c2espcommon.c:282:50: [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). DoLog("Found marker %d level %d",GetColour, atoi(MarkerLevelString + 1)); data/c2esp-27/src/c2espcommon.c:283:14: [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). return (atoi(MarkerLevelString + 1)); data/c2esp-27/src/c2espcommon.c:309:2: [2] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). Risk is low because the source is a constant string. strcpy(Size, "MediaSize=na_letter_8.5x11in;"); //default data/c2esp-27/src/c2espcommon.c:314:3: [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(Size, "MediaSize=iso_a6_105x148mm;"); data/c2esp-27/src/c2espcommon.c:317:3: [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(Size, "MediaSize=na_index4x6_4x6in;"); data/c2esp-27/src/c2espcommon.c:320:3: [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(Size, "MediaSize=na_5x7_5x7in;"); data/c2esp-27/src/c2espcommon.c:325:3: [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(Size, "MediaSize=iso_a5_148x210mm;"); data/c2esp-27/src/c2espcommon.c:328:3: [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(Size, "MediaSize=iso_dl_110x220mm;"); data/c2esp-27/src/c2espcommon.c:331:3: [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(Size, "MediaSize=iso_c5_162x229mm;"); data/c2esp-27/src/c2espcommon.c:334:3: [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(Size, "MediaSize=na_number10_4.125x9.5in;"); data/c2esp-27/src/c2espcommon.c:337:3: [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(Size, "MediaSize=iso_b5_176x250mm;"); data/c2esp-27/src/c2espcommon.c:340:3: [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(Size, "MediaSize=na_govtletter_8x10in;"); data/c2esp-27/src/c2espcommon.c:343:3: [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(Size, "MediaSize=na_executive_7.25x10.5in;"); data/c2esp-27/src/c2espcommon.c:346:3: [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(Size, "MediaSize=na_letter_8.5x11in;"); data/c2esp-27/src/c2espcommon.c:349:3: [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(Size, "MediaSize=iso_a4_210x297mm;"); data/c2esp-27/src/c2espcommon.c:352:3: [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(Size, "MediaSize=na_legal_8.5x14in;"); data/c2esp-27/src/c2espcommon.h:38: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 BackBuf[32000]; //for the back channel replies from the printer data/c2esp-27/src/command2esp.c:107: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 line[1024], /* Line from file */ data/c2esp-27/src/command2esp.c:142:15: [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). if ((fp = fopen(argv[6], "r")) == NULL) data/c2esp-27/src/c2espC.c:682:8: [1] (buffer) fgetc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). c=fgetc(CompData); data/c2esp-27/src/c2espcommon.c:70:5: [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(ExtLogFileName)>0) data/c2esp-27/src/c2espcommon.c:98:2: [1] (buffer) strncat: Easily used incorrectly (e.g., incorrectly computing the correct maximum size to add) [MS-banned] (CWE-120). Consider strcat_s, strlcat, snprintf, or automatically resizing strings. strncat(CupsFormat,PrintFormat,150); //crop PrintFormat to avoid FAILING WITH BUFFER OVERFLOW data/c2esp-27/src/c2espcommon.c:100: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). if(CupsFormat[strlen(CupsFormat)-1] != NL) strcat(CupsFormat,"\n"); data/c2esp-27/src/c2espcommon.c:100:45: [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. if(CupsFormat[strlen(CupsFormat)-1] != NL) strcat(CupsFormat,"\n"); data/c2esp-27/src/c2espcommon.c:112:2: [1] (buffer) strncat: Easily used incorrectly (e.g., incorrectly computing the correct maximum size to add) [MS-banned] (CWE-120). Consider strcat_s, strlcat, snprintf, or automatically resizing strings. strncat(CupsFormat,PrintFormat,150); //crop PrintFormat to avoid FAILING WITH BUFFER OVERFLOW data/c2esp-27/src/c2espcommon.c:239: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 (strncmp(Token1 , Expect, strlen(Expect) -1) == 0) //reduce string length by 1 as ; removed data/c2esp-27/src/command2esp.c:161: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). lineptr = line + strlen(line) - 1; ANALYSIS SUMMARY: Hits = 88 Lines analyzed = 2872 in approximately 0.12 seconds (23839 lines/second) Physical Source Lines of Code (SLOC) = 1970 Hits@level = [0] 23 [1] 8 [2] 49 [3] 3 [4] 20 [5] 8 Hits@level+ = [0+] 111 [1+] 88 [2+] 80 [3+] 31 [4+] 28 [5+] 8 Hits/KSLOC@level+ = [0+] 56.3452 [1+] 44.6701 [2+] 40.6091 [3+] 15.736 [4+] 14.2132 [5+] 4.06091 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.