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/libjpeg6b-6b2/jcomapi.c Examining data/libjpeg6b-6b2/jinclude.h Examining data/libjpeg6b-6b2/wrjpgcom.c Examining data/libjpeg6b-6b2/jidctfst.c Examining data/libjpeg6b-6b2/jmemmac.c Examining data/libjpeg6b-6b2/jcmarker.c Examining data/libjpeg6b-6b2/jdct.h Examining data/libjpeg6b-6b2/jidctred.c Examining data/libjpeg6b-6b2/cdjpeg.c Examining data/libjpeg6b-6b2/wrgif.c Examining data/libjpeg6b-6b2/jcinit.c Examining data/libjpeg6b-6b2/ansi2knr.c Examining data/libjpeg6b-6b2/jquant1.c Examining data/libjpeg6b-6b2/jdphuff.c Examining data/libjpeg6b-6b2/jdapistd.c Examining data/libjpeg6b-6b2/cderror.h Examining data/libjpeg6b-6b2/rdppm.c Examining data/libjpeg6b-6b2/jdmaster.c Examining data/libjpeg6b-6b2/ckconfig.c Examining data/libjpeg6b-6b2/transupp.c Examining data/libjpeg6b-6b2/rdjpgcom.c Examining data/libjpeg6b-6b2/jmemmgr.c Examining data/libjpeg6b-6b2/jdapimin.c Examining data/libjpeg6b-6b2/jutils.c Examining data/libjpeg6b-6b2/jchuff.h Examining data/libjpeg6b-6b2/jccolor.c Examining data/libjpeg6b-6b2/jmorecfg.h Examining data/libjpeg6b-6b2/jdtrans.c Examining data/libjpeg6b-6b2/jdsample.c Examining data/libjpeg6b-6b2/jpegtran.c Examining data/libjpeg6b-6b2/jcsample.c Examining data/libjpeg6b-6b2/jquant2.c Examining data/libjpeg6b-6b2/jdpostct.c Examining data/libjpeg6b-6b2/jerror.c Examining data/libjpeg6b-6b2/jcphuff.c Examining data/libjpeg6b-6b2/jdatasrc.c Examining data/libjpeg6b-6b2/jcapimin.c Examining data/libjpeg6b-6b2/jdhuff.h Examining data/libjpeg6b-6b2/jcdctmgr.c Examining data/libjpeg6b-6b2/jcapistd.c Examining data/libjpeg6b-6b2/jdatadst.c Examining data/libjpeg6b-6b2/jcmaster.c Examining data/libjpeg6b-6b2/jcprepct.c Examining data/libjpeg6b-6b2/jccoefct.c Examining data/libjpeg6b-6b2/jchuff.c Examining data/libjpeg6b-6b2/cjpeg.c Examining data/libjpeg6b-6b2/jdmerge.c Examining data/libjpeg6b-6b2/jidctflt.c Examining data/libjpeg6b-6b2/rdtarga.c Examining data/libjpeg6b-6b2/djpeg.c Examining data/libjpeg6b-6b2/wrppm.c Examining data/libjpeg6b-6b2/jfdctflt.c Examining data/libjpeg6b-6b2/jerror.h Examining data/libjpeg6b-6b2/wrrle.c Examining data/libjpeg6b-6b2/jcmainct.c Examining data/libjpeg6b-6b2/jmemansi.c Examining data/libjpeg6b-6b2/jcparam.c Examining data/libjpeg6b-6b2/cdjpeg.h Examining data/libjpeg6b-6b2/jfdctfst.c Examining data/libjpeg6b-6b2/jversion.h Examining data/libjpeg6b-6b2/example.c Examining data/libjpeg6b-6b2/jmemname.c Examining data/libjpeg6b-6b2/jdhuff.c Examining data/libjpeg6b-6b2/jddctmgr.c Examining data/libjpeg6b-6b2/jmemnobs.c Examining data/libjpeg6b-6b2/wrtarga.c Examining data/libjpeg6b-6b2/rdcolmap.c Examining data/libjpeg6b-6b2/jmemsys.h Examining data/libjpeg6b-6b2/jmemdos.c Examining data/libjpeg6b-6b2/jidctint.c Examining data/libjpeg6b-6b2/jdcoefct.c Examining data/libjpeg6b-6b2/transupp.h Examining data/libjpeg6b-6b2/jdinput.c Examining data/libjpeg6b-6b2/jdcolor.c Examining data/libjpeg6b-6b2/jpegint.h Examining data/libjpeg6b-6b2/rdrle.c Examining data/libjpeg6b-6b2/rdswitch.c Examining data/libjpeg6b-6b2/jdmainct.c Examining data/libjpeg6b-6b2/jfdctint.c Examining data/libjpeg6b-6b2/rdbmp.c Examining data/libjpeg6b-6b2/rdgif.c Examining data/libjpeg6b-6b2/jdmarker.c Examining data/libjpeg6b-6b2/jctrans.c Examining data/libjpeg6b-6b2/wrbmp.c Examining data/libjpeg6b-6b2/debian/patches/extern_C-jpeglib.h Examining data/libjpeg6b-6b2/jpeglib.h FINAL RESULTS: data/libjpeg6b-6b2/ansi2knr.c:403:8: [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(buf, more); data/libjpeg6b-6b2/jerror.c:193:5: [4] (format) sprintf: Potential format string problem (CWE-134). Make format string constant. sprintf(buffer, msgtext, err->msg_parm.s); data/libjpeg6b-6b2/jerror.c:195:5: [4] (format) sprintf: Potential format string problem (CWE-134). Make format string constant. sprintf(buffer, msgtext, data/libjpeg6b-6b2/jmemmac.c:240:5: [4] (format) sprintf: Potential format string problem (CWE-134). Make format string constant. sprintf(info->temp_name, TEMP_FILE_NAME, next_file_num); data/libjpeg6b-6b2/jmemmac.c:241: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 ( (Ptr)fName+1, info->temp_name ); data/libjpeg6b-6b2/jmemname.c:102:5: [4] (format) sprintf: Potential format string problem (CWE-134). Make format string constant. sprintf(fname, TEMP_FILE_NAME, TEMP_DIRECTORY, next_file_num); data/libjpeg6b-6b2/jmemname.c:129:3: [4] (format) sprintf: Potential format string problem (CWE-134). Make format string constant. sprintf(fname, TEMP_FILE_NAME, TEMP_DIRECTORY, next_file_num); data/libjpeg6b-6b2/jmemname.c:130:3: [4] (tmpfile) mktemp: Temporary file race condition (CWE-377). mktemp(fname); /* make sure file name is unique */ data/libjpeg6b-6b2/wrjpgcom.c:456: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(comment_arg, argv[argn]+1); data/libjpeg6b-6b2/wrjpgcom.c:466:4: [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(comment_arg, argv[argn]); data/libjpeg6b-6b2/jmemdos.c:50:15: [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. extern char * getenv JPP((const char * name)); data/libjpeg6b-6b2/jmemdos.c:139:31: [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 ((env = (const char *) getenv("TMP")) == NULL) data/libjpeg6b-6b2/jmemdos.c:140:33: [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 ((env = (const char *) getenv("TEMP")) == NULL) data/libjpeg6b-6b2/jmemmgr.c:35:15: [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. extern char * getenv JPP((const char * name)); data/libjpeg6b-6b2/jmemmgr.c:1106:19: [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 ((memenv = getenv("JPEGMEM")) != NULL) { data/libjpeg6b-6b2/ansi2knr.c:358: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). out = fopen(argv[2], "w"); data/libjpeg6b-6b2/ansi2knr.c:364:7: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). in = fopen(argv[1], "r"); data/libjpeg6b-6b2/cjpeg.c:539: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). if ((input_file = fopen(argv[file_index], READ_BINARY)) == NULL) { data/libjpeg6b-6b2/cjpeg.c:550:24: [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 ((output_file = fopen(outfilename, WRITE_BINARY)) == NULL) { data/libjpeg6b-6b2/ckconfig.c:297:18: [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 ((outfile = fopen("jconfig.h", "w")) == NULL) { data/libjpeg6b-6b2/djpeg.c:274:17: [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 ((mapfile = fopen(argv[argn], READ_BINARY)) == NULL) { data/libjpeg6b-6b2/djpeg.c:504: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). if ((input_file = fopen(argv[file_index], READ_BINARY)) == NULL) { data/libjpeg6b-6b2/djpeg.c:515:24: [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 ((output_file = fopen(outfilename, WRITE_BINARY)) == NULL) { data/libjpeg6b-6b2/example.c:114:18: [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 ((outfile = fopen(filename, "wb")) == NULL) { data/libjpeg6b-6b2/example.c:306:17: [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 ((infile = fopen(filename, "rb")) == NULL) { data/libjpeg6b-6b2/jchuff.c:185: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 huffsize[257]; data/libjpeg6b-6b2/jchuff.h:29: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 ehufsi[256]; /* length of code for each symbol */ data/libjpeg6b-6b2/jcmarker.c:228: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 dc_in_use[NUM_ARITH_TBLS]; data/libjpeg6b-6b2/jcmarker.c:229: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 ac_in_use[NUM_ARITH_TBLS]; data/libjpeg6b-6b2/jdhuff.c:156: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 huffsize[257]; data/libjpeg6b-6b2/jerror.c:100: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 buffer[JMSG_LENGTH_MAX]; data/libjpeg6b-6b2/jinclude.h:62:32: [2] (buffer) bcopy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. #define MEMCOPY(dest,src,size) bcopy((const void *)(src), (void *)(dest), (size_t)(size)) data/libjpeg6b-6b2/jinclude.h:68:32: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. #define MEMCOPY(dest,src,size) memcpy((void *)(dest), (const void *)(src), (size_t)(size)) data/libjpeg6b-6b2/jmemansi.c:144:26: [2] (tmpfile) tmpfile: Function tmpfile() has a security flaw on some systems (e.g., older System V systems) (CWE-377). if ((info->temp_file = tmpfile()) == NULL) data/libjpeg6b-6b2/jmemdos.c:151: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(ptr, "JPG%03d.TMP", next_file_num); data/libjpeg6b-6b2/jmemdos.c:153:18: [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 ((tfile = fopen(fname, READ_BINARY)) == NULL) data/libjpeg6b-6b2/jmemdos.c:339: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 endbuffer[2]; data/libjpeg6b-6b2/jmemdos.c:360:7: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. ((char FAR *) buffer_address)[byte_count - 1L] = endbuffer[0]; data/libjpeg6b-6b2/jmemdos.c:372: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 endbuffer[2]; data/libjpeg6b-6b2/jmemdos.c:393:22: [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. endbuffer[0] = ((char FAR *) buffer_address)[byte_count - 1L]; data/libjpeg6b-6b2/jmemdos.c:468: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 bytes[18]; /* Misaligned fields in here! */ data/libjpeg6b-6b2/jmemname.c:103:18: [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 ((tfile = fopen(fname, READ_BINARY)) == NULL) { data/libjpeg6b-6b2/jmemname.c:251:26: [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 ((info->temp_file = fopen(info->temp_name, RW_BINARY)) == NULL) data/libjpeg6b-6b2/jmemsys.h:156: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 temp_name[TEMP_NAME_LENGTH]; /* name if it's a file */ data/libjpeg6b-6b2/jmemsys.h:162: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 temp_name[TEMP_NAME_LENGTH]; /* name if it's a file */ data/libjpeg6b-6b2/jmemsys.h:166: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 temp_name[TEMP_NAME_LENGTH]; /* name of temp file */ data/libjpeg6b-6b2/jpeglib.h:667:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char s[JMSG_STR_PARM_MAX]; data/libjpeg6b-6b2/jpegtran.c:409: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). if ((input_file = fopen(argv[file_index], READ_BINARY)) == NULL) { data/libjpeg6b-6b2/jpegtran.c:420:24: [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 ((output_file = fopen(outfilename, WRITE_BINARY)) == NULL) { data/libjpeg6b-6b2/rdjpgcom.c:471:19: [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 ((infile = fopen(argv[argn], READ_BINARY)) == NULL) { data/libjpeg6b-6b2/rdswitch.c:90: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). if ((fp = fopen(filename, "r")) == NULL) { data/libjpeg6b-6b2/rdswitch.c:182: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). if ((fp = fopen(filename, "r")) == NULL) { data/libjpeg6b-6b2/wrbmp.c:160: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 bmpfileheader[14]; data/libjpeg6b-6b2/wrbmp.c:161: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 bmpinfoheader[40]; data/libjpeg6b-6b2/wrbmp.c:233: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 bmpfileheader[14]; data/libjpeg6b-6b2/wrbmp.c:234: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 bmpcoreheader[12]; data/libjpeg6b-6b2/wrgif.c:65: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 packetbuf[256]; /* workspace for accumulating packet */ data/libjpeg6b-6b2/wrjpgcom.c:442:27: [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 ((comment_file = fopen(argv[argn], "r")) == NULL) { data/libjpeg6b-6b2/wrjpgcom.c:485:19: [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 ((infile = fopen(argv[argn], READ_BINARY)) == NULL) { data/libjpeg6b-6b2/wrjpgcom.c:512:18: [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 ((outfile = fopen(argv[argn+1], WRITE_BINARY)) == NULL) { data/libjpeg6b-6b2/wrrle.c:178: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 cmapcomment[80]; data/libjpeg6b-6b2/wrrle.c:202: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(cmapcomment, "color_map_length=%d", cinfo->actual_number_of_colors); data/libjpeg6b-6b2/wrtarga.c:57:3: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char targaheader[18]; data/libjpeg6b-6b2/ansi2knr.c:260: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). extern int strlen(), strncmp(); data/libjpeg6b-6b2/ansi2knr.c:374: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). test: line += strlen(line); data/libjpeg6b-6b2/ansi2knr.c:397: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). line += strlen(line); data/libjpeg6b-6b2/ansi2knr.c:485: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). bend = skipspace(buf + strlen(buf) - 1, -1); data/libjpeg6b-6b2/ansi2knr.c:518: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). { if ( strlen(kp) == len && !strncmp(kp, buf, len) ) data/libjpeg6b-6b2/cjpeg.c:92:12: [1] (buffer) getc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if ((c = getc(infile)) == EOF) data/libjpeg6b-6b2/jerror.h:232:4: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy((cinfo)->err->msg_parm.s, (str), JMSG_STR_PARM_MAX), \ data/libjpeg6b-6b2/jerror.h:288:4: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy((cinfo)->err->msg_parm.s, (str), JMSG_STR_PARM_MAX), \ data/libjpeg6b-6b2/jmemmac.c:242: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). *fName = strlen (info->temp_name); data/libjpeg6b-6b2/rdbmp.c:74:12: [1] (buffer) getc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if ((c = getc(infile)) == EOF) data/libjpeg6b-6b2/rdbmp.c:210:16: [1] (buffer) getc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if ((c = getc(infile)) == EOF) data/libjpeg6b-6b2/rdcolmap.c:88:22: [1] (buffer) getc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if ((header[i] = getc(infile)) == EOF) data/libjpeg6b-6b2/rdcolmap.c:104:9: [1] (buffer) getc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). R = getc(infile); data/libjpeg6b-6b2/rdcolmap.c:105:9: [1] (buffer) getc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). G = getc(infile); data/libjpeg6b-6b2/rdcolmap.c:106:9: [1] (buffer) getc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). B = getc(infile); data/libjpeg6b-6b2/rdcolmap.c:127:8: [1] (buffer) getc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). ch = getc(infile); data/libjpeg6b-6b2/rdcolmap.c:130:12: [1] (buffer) getc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). ch = getc(infile); data/libjpeg6b-6b2/rdcolmap.c:178:7: [1] (buffer) getc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). c = getc(infile); /* save format discriminator for a sec */ data/libjpeg6b-6b2/rdcolmap.c:207:6: [1] (buffer) getc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). R = getc(infile); data/libjpeg6b-6b2/rdcolmap.c:208:6: [1] (buffer) getc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). G = getc(infile); data/libjpeg6b-6b2/rdcolmap.c:209:6: [1] (buffer) getc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). B = getc(infile); data/libjpeg6b-6b2/rdcolmap.c:240:11: [1] (buffer) getc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). switch (getc(infile)) { data/libjpeg6b-6b2/rdjpgcom.c:64:21: [1] (buffer) getc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). #define NEXTBYTE() getc(infile) data/libjpeg6b-6b2/rdppm.c:90:8: [1] (buffer) getc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). ch = getc(infile); data/libjpeg6b-6b2/rdppm.c:93:12: [1] (buffer) getc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). ch = getc(infile); data/libjpeg6b-6b2/rdppm.c:303:7: [1] (buffer) getc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if (getc(source->pub.input_file) != 'P') data/libjpeg6b-6b2/rdppm.c:306:7: [1] (buffer) getc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). c = getc(source->pub.input_file); /* subformat discriminator character */ data/libjpeg6b-6b2/rdswitch.c:27:8: [1] (buffer) getc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). ch = getc(file); data/libjpeg6b-6b2/rdswitch.c:30:12: [1] (buffer) getc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). ch = getc(file); data/libjpeg6b-6b2/rdtarga.c:94:12: [1] (buffer) getc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if ((c = getc(infile)) == EOF) data/libjpeg6b-6b2/rdtarga.c:130:36: [1] (buffer) getc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). sinfo->tga_pixel[i] = (U_CHAR) getc(infile); data/libjpeg6b-6b2/rdtarga.c:161:36: [1] (buffer) getc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). sinfo->tga_pixel[i] = (U_CHAR) getc(infile); data/libjpeg6b-6b2/wrjpgcom.c:78:21: [1] (buffer) getc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). #define NEXTBYTE() getc(infile) data/libjpeg6b-6b2/wrjpgcom.c:458:36: [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). comment_length = (unsigned int) strlen(comment_arg); data/libjpeg6b-6b2/wrjpgcom.c:465:4: [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(comment_arg, " "); data/libjpeg6b-6b2/wrjpgcom.c:469:39: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). comment_length = (unsigned int) strlen(comment_arg); data/libjpeg6b-6b2/wrjpgcom.c:546:17: [1] (buffer) getc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). while ((c = getc(src_file)) != EOF) { ANALYSIS SUMMARY: Hits = 100 Lines analyzed = 35124 in approximately 1.11 seconds (31751 lines/second) Physical Source Lines of Code (SLOC) = 20371 Hits@level = [0] 253 [1] 37 [2] 48 [3] 5 [4] 10 [5] 0 Hits@level+ = [0+] 353 [1+] 100 [2+] 63 [3+] 15 [4+] 10 [5+] 0 Hits/KSLOC@level+ = [0+] 17.3286 [1+] 4.90894 [2+] 3.09263 [3+] 0.736341 [4+] 0.490894 [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.