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/libjpeg-turbo-2.0.5/cderror.h Examining data/libjpeg-turbo-2.0.5/cdjpeg.c Examining data/libjpeg-turbo-2.0.5/cdjpeg.h Examining data/libjpeg-turbo-2.0.5/cjpeg.c Examining data/libjpeg-turbo-2.0.5/cmyk.h Examining data/libjpeg-turbo-2.0.5/djpeg.c Examining data/libjpeg-turbo-2.0.5/jaricom.c Examining data/libjpeg-turbo-2.0.5/java/org_libjpegturbo_turbojpeg_TJ.h Examining data/libjpeg-turbo-2.0.5/java/org_libjpegturbo_turbojpeg_TJCompressor.h Examining data/libjpeg-turbo-2.0.5/java/org_libjpegturbo_turbojpeg_TJDecompressor.h Examining data/libjpeg-turbo-2.0.5/java/org_libjpegturbo_turbojpeg_TJTransformer.h Examining data/libjpeg-turbo-2.0.5/jcapimin.c Examining data/libjpeg-turbo-2.0.5/jcapistd.c Examining data/libjpeg-turbo-2.0.5/jcarith.c Examining data/libjpeg-turbo-2.0.5/jccoefct.c Examining data/libjpeg-turbo-2.0.5/jccolext.c Examining data/libjpeg-turbo-2.0.5/jccolor.c Examining data/libjpeg-turbo-2.0.5/jcdctmgr.c Examining data/libjpeg-turbo-2.0.5/jchuff.c Examining data/libjpeg-turbo-2.0.5/jchuff.h Examining data/libjpeg-turbo-2.0.5/jcicc.c Examining data/libjpeg-turbo-2.0.5/jcinit.c Examining data/libjpeg-turbo-2.0.5/jcmainct.c Examining data/libjpeg-turbo-2.0.5/jcmarker.c Examining data/libjpeg-turbo-2.0.5/jcmaster.c Examining data/libjpeg-turbo-2.0.5/jcomapi.c Examining data/libjpeg-turbo-2.0.5/jcparam.c Examining data/libjpeg-turbo-2.0.5/jcphuff.c Examining data/libjpeg-turbo-2.0.5/jcprepct.c Examining data/libjpeg-turbo-2.0.5/jcsample.c Examining data/libjpeg-turbo-2.0.5/jcstest.c Examining data/libjpeg-turbo-2.0.5/jctrans.c Examining data/libjpeg-turbo-2.0.5/jdapimin.c Examining data/libjpeg-turbo-2.0.5/jdapistd.c Examining data/libjpeg-turbo-2.0.5/jdarith.c Examining data/libjpeg-turbo-2.0.5/jdatadst-tj.c Examining data/libjpeg-turbo-2.0.5/jdatadst.c Examining data/libjpeg-turbo-2.0.5/jdatasrc-tj.c Examining data/libjpeg-turbo-2.0.5/jdatasrc.c Examining data/libjpeg-turbo-2.0.5/jdcoefct.c Examining data/libjpeg-turbo-2.0.5/jdcoefct.h Examining data/libjpeg-turbo-2.0.5/jdcol565.c Examining data/libjpeg-turbo-2.0.5/jdcolext.c Examining data/libjpeg-turbo-2.0.5/jdcolor.c Examining data/libjpeg-turbo-2.0.5/jdct.h Examining data/libjpeg-turbo-2.0.5/jddctmgr.c Examining data/libjpeg-turbo-2.0.5/jdhuff.c Examining data/libjpeg-turbo-2.0.5/jdhuff.h Examining data/libjpeg-turbo-2.0.5/jdicc.c Examining data/libjpeg-turbo-2.0.5/jdinput.c Examining data/libjpeg-turbo-2.0.5/jdmainct.c Examining data/libjpeg-turbo-2.0.5/jdmainct.h Examining data/libjpeg-turbo-2.0.5/jdmarker.c Examining data/libjpeg-turbo-2.0.5/jdmaster.c Examining data/libjpeg-turbo-2.0.5/jdmaster.h Examining data/libjpeg-turbo-2.0.5/jdmerge.c Examining data/libjpeg-turbo-2.0.5/jdmrg565.c Examining data/libjpeg-turbo-2.0.5/jdmrgext.c Examining data/libjpeg-turbo-2.0.5/jdphuff.c Examining data/libjpeg-turbo-2.0.5/jdpostct.c Examining data/libjpeg-turbo-2.0.5/jdsample.c Examining data/libjpeg-turbo-2.0.5/jdsample.h Examining data/libjpeg-turbo-2.0.5/jdtrans.c Examining data/libjpeg-turbo-2.0.5/jerror.c Examining data/libjpeg-turbo-2.0.5/jerror.h Examining data/libjpeg-turbo-2.0.5/jfdctflt.c Examining data/libjpeg-turbo-2.0.5/jfdctfst.c Examining data/libjpeg-turbo-2.0.5/jfdctint.c Examining data/libjpeg-turbo-2.0.5/jidctflt.c Examining data/libjpeg-turbo-2.0.5/jidctfst.c Examining data/libjpeg-turbo-2.0.5/jidctint.c Examining data/libjpeg-turbo-2.0.5/jidctred.c Examining data/libjpeg-turbo-2.0.5/jinclude.h Examining data/libjpeg-turbo-2.0.5/jmemmgr.c Examining data/libjpeg-turbo-2.0.5/jmemnobs.c Examining data/libjpeg-turbo-2.0.5/jmemsys.h Examining data/libjpeg-turbo-2.0.5/jmorecfg.h Examining data/libjpeg-turbo-2.0.5/jpeg_nbits_table.h Examining data/libjpeg-turbo-2.0.5/jpegcomp.h Examining data/libjpeg-turbo-2.0.5/jpegint.h Examining data/libjpeg-turbo-2.0.5/jpeglib.h Examining data/libjpeg-turbo-2.0.5/jpegtran.c Examining data/libjpeg-turbo-2.0.5/jquant1.c Examining data/libjpeg-turbo-2.0.5/jquant2.c Examining data/libjpeg-turbo-2.0.5/jsimd.h Examining data/libjpeg-turbo-2.0.5/jsimd_none.c Examining data/libjpeg-turbo-2.0.5/jsimddct.h Examining data/libjpeg-turbo-2.0.5/jstdhuff.c Examining data/libjpeg-turbo-2.0.5/jutils.c Examining data/libjpeg-turbo-2.0.5/jversion.h Examining data/libjpeg-turbo-2.0.5/md5/md5.c Examining data/libjpeg-turbo-2.0.5/md5/md5.h Examining data/libjpeg-turbo-2.0.5/md5/md5cmp.c Examining data/libjpeg-turbo-2.0.5/md5/md5hl.c Examining data/libjpeg-turbo-2.0.5/rdbmp.c Examining data/libjpeg-turbo-2.0.5/rdcolmap.c Examining data/libjpeg-turbo-2.0.5/rdgif.c Examining data/libjpeg-turbo-2.0.5/rdjpgcom.c Examining data/libjpeg-turbo-2.0.5/rdppm.c Examining data/libjpeg-turbo-2.0.5/rdrle.c Examining data/libjpeg-turbo-2.0.5/rdswitch.c Examining data/libjpeg-turbo-2.0.5/rdtarga.c Examining data/libjpeg-turbo-2.0.5/simd/arm/jsimd.c Examining data/libjpeg-turbo-2.0.5/simd/arm64/jsimd.c Examining data/libjpeg-turbo-2.0.5/simd/i386/jsimd.c Examining data/libjpeg-turbo-2.0.5/simd/jsimd.h Examining data/libjpeg-turbo-2.0.5/simd/loongson/jccolext-mmi.c Examining data/libjpeg-turbo-2.0.5/simd/loongson/jccolor-mmi.c Examining data/libjpeg-turbo-2.0.5/simd/loongson/jcsample-mmi.c Examining data/libjpeg-turbo-2.0.5/simd/loongson/jcsample.h Examining data/libjpeg-turbo-2.0.5/simd/loongson/jdcolext-mmi.c Examining data/libjpeg-turbo-2.0.5/simd/loongson/jdcolor-mmi.c Examining data/libjpeg-turbo-2.0.5/simd/loongson/jdsample-mmi.c Examining data/libjpeg-turbo-2.0.5/simd/loongson/jfdctint-mmi.c Examining data/libjpeg-turbo-2.0.5/simd/loongson/jidctint-mmi.c Examining data/libjpeg-turbo-2.0.5/simd/loongson/jquanti-mmi.c Examining data/libjpeg-turbo-2.0.5/simd/loongson/jsimd.c Examining data/libjpeg-turbo-2.0.5/simd/loongson/jsimd_mmi.h Examining data/libjpeg-turbo-2.0.5/simd/loongson/loongson-mmintrin.h Examining data/libjpeg-turbo-2.0.5/simd/mips/jsimd.c Examining data/libjpeg-turbo-2.0.5/simd/mips/jsimd_dspr2_asm.h Examining data/libjpeg-turbo-2.0.5/simd/nasm/jsimdcfg.inc.h Examining data/libjpeg-turbo-2.0.5/simd/powerpc/jccolext-altivec.c Examining data/libjpeg-turbo-2.0.5/simd/powerpc/jccolor-altivec.c Examining data/libjpeg-turbo-2.0.5/simd/powerpc/jcgray-altivec.c Examining data/libjpeg-turbo-2.0.5/simd/powerpc/jcgryext-altivec.c Examining data/libjpeg-turbo-2.0.5/simd/powerpc/jcsample-altivec.c Examining data/libjpeg-turbo-2.0.5/simd/powerpc/jcsample.h Examining data/libjpeg-turbo-2.0.5/simd/powerpc/jdcolext-altivec.c Examining data/libjpeg-turbo-2.0.5/simd/powerpc/jdcolor-altivec.c Examining data/libjpeg-turbo-2.0.5/simd/powerpc/jdmerge-altivec.c Examining data/libjpeg-turbo-2.0.5/simd/powerpc/jdmrgext-altivec.c Examining data/libjpeg-turbo-2.0.5/simd/powerpc/jdsample-altivec.c Examining data/libjpeg-turbo-2.0.5/simd/powerpc/jfdctfst-altivec.c Examining data/libjpeg-turbo-2.0.5/simd/powerpc/jfdctint-altivec.c Examining data/libjpeg-turbo-2.0.5/simd/powerpc/jidctfst-altivec.c Examining data/libjpeg-turbo-2.0.5/simd/powerpc/jidctint-altivec.c Examining data/libjpeg-turbo-2.0.5/simd/powerpc/jquanti-altivec.c Examining data/libjpeg-turbo-2.0.5/simd/powerpc/jsimd.c Examining data/libjpeg-turbo-2.0.5/simd/powerpc/jsimd_altivec.h Examining data/libjpeg-turbo-2.0.5/simd/x86_64/jsimd.c Examining data/libjpeg-turbo-2.0.5/tjbench.c Examining data/libjpeg-turbo-2.0.5/tjexample.c Examining data/libjpeg-turbo-2.0.5/tjunittest.c Examining data/libjpeg-turbo-2.0.5/tjutil.c Examining data/libjpeg-turbo-2.0.5/tjutil.h Examining data/libjpeg-turbo-2.0.5/transupp.c Examining data/libjpeg-turbo-2.0.5/transupp.h Examining data/libjpeg-turbo-2.0.5/turbojpeg-jni.c Examining data/libjpeg-turbo-2.0.5/turbojpeg.c Examining data/libjpeg-turbo-2.0.5/turbojpeg.h Examining data/libjpeg-turbo-2.0.5/wrbmp.c Examining data/libjpeg-turbo-2.0.5/wrgif.c Examining data/libjpeg-turbo-2.0.5/wrjpgcom.c Examining data/libjpeg-turbo-2.0.5/wrppm.c Examining data/libjpeg-turbo-2.0.5/wrrle.c Examining data/libjpeg-turbo-2.0.5/wrtarga.c Examining data/libjpeg-turbo-2.0.5/debian/extra/jpegexiforient.c FINAL RESULTS: data/libjpeg-turbo-2.0.5/jerror.c:192:5: [4] (format) sprintf: Potential format string problem (CWE-134). Make format string constant. sprintf(buffer, msgtext, err->msg_parm.s); data/libjpeg-turbo-2.0.5/jerror.c:194:5: [4] (format) sprintf: Potential format string problem (CWE-134). Make format string constant. sprintf(buffer, msgtext, data/libjpeg-turbo-2.0.5/tjbench.c:120:3: [4] (format) snprintf: If format strings can be influenced by an attacker, they can be exploited, and note that sprintf variations do not always \0-terminate (CWE-134). Use a constant for the format specification. snprintf(buf, len, format, val); data/libjpeg-turbo-2.0.5/tjutil.h:32:9: [4] (format) snprintf: If format strings can be influenced by an attacker, they can be exploited, and note that sprintf variations do not always \0-terminate (CWE-134). Use a constant for the format specification. #define snprintf(str, n, format, ...) \ data/libjpeg-turbo-2.0.5/wrjpgcom.c:455: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(comment_arg, argv[argn] + 1); data/libjpeg-turbo-2.0.5/wrjpgcom.c:471: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). strcat(comment_arg, argv[argn]); data/libjpeg-turbo-2.0.5/jmemmgr.c:42:14: [3] (buffer) getenv: Environment variables are untrustable input if they can be set by an attacker. They can have any content and length, and the same variable can be set more than once (CWE-807, CWE-20). Check environment variables carefully before using them. extern char *getenv(const char *name); data/libjpeg-turbo-2.0.5/jmemmgr.c:1167: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/libjpeg-turbo-2.0.5/simd/arm/jsimd.c:133:9: [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. env = getenv("JSIMD_FORCENEON"); data/libjpeg-turbo-2.0.5/simd/arm/jsimd.c:136:9: [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. env = getenv("JSIMD_FORCENONE"); data/libjpeg-turbo-2.0.5/simd/arm/jsimd.c:139:9: [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. env = getenv("JSIMD_NOHUFFENC"); data/libjpeg-turbo-2.0.5/simd/arm64/jsimd.c:148:9: [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. env = getenv("JSIMD_FORCENEON"); data/libjpeg-turbo-2.0.5/simd/arm64/jsimd.c:151:9: [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. env = getenv("JSIMD_FORCENONE"); data/libjpeg-turbo-2.0.5/simd/arm64/jsimd.c:154:9: [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. env = getenv("JSIMD_NOHUFFENC"); data/libjpeg-turbo-2.0.5/simd/arm64/jsimd.c:157:9: [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. env = getenv("JSIMD_FASTLD3"); data/libjpeg-turbo-2.0.5/simd/arm64/jsimd.c:162:9: [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. env = getenv("JSIMD_FASTST3"); data/libjpeg-turbo-2.0.5/simd/i386/jsimd.c:57:9: [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. env = getenv("JSIMD_FORCEMMX"); data/libjpeg-turbo-2.0.5/simd/i386/jsimd.c:60:9: [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. env = getenv("JSIMD_FORCE3DNOW"); data/libjpeg-turbo-2.0.5/simd/i386/jsimd.c:63:9: [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. env = getenv("JSIMD_FORCESSE"); data/libjpeg-turbo-2.0.5/simd/i386/jsimd.c:66:9: [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. env = getenv("JSIMD_FORCESSE2"); data/libjpeg-turbo-2.0.5/simd/i386/jsimd.c:69:9: [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. env = getenv("JSIMD_FORCEAVX2"); data/libjpeg-turbo-2.0.5/simd/i386/jsimd.c:72:9: [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. env = getenv("JSIMD_FORCENONE"); data/libjpeg-turbo-2.0.5/simd/i386/jsimd.c:75:9: [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. env = getenv("JSIMD_NOHUFFENC"); data/libjpeg-turbo-2.0.5/simd/loongson/jsimd.c:48:9: [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. env = getenv("JSIMD_FORCENONE"); data/libjpeg-turbo-2.0.5/simd/mips/jsimd.c:86:9: [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. env = getenv("JSIMD_FORCEDSPR2"); data/libjpeg-turbo-2.0.5/simd/mips/jsimd.c:89:9: [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. env = getenv("JSIMD_FORCENONE"); data/libjpeg-turbo-2.0.5/simd/powerpc/jsimd.c:151:9: [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. env = getenv("JSIMD_FORCEALTIVEC"); data/libjpeg-turbo-2.0.5/simd/powerpc/jsimd.c:154:9: [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. env = getenv("JSIMD_FORCENONE"); data/libjpeg-turbo-2.0.5/simd/x86_64/jsimd.c:57:9: [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. env = getenv("JSIMD_FORCESSE2"); data/libjpeg-turbo-2.0.5/simd/x86_64/jsimd.c:60:9: [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. env = getenv("JSIMD_FORCEAVX2"); data/libjpeg-turbo-2.0.5/simd/x86_64/jsimd.c:63:9: [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. env = getenv("JSIMD_FORCENONE"); data/libjpeg-turbo-2.0.5/simd/x86_64/jsimd.c:66:9: [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. env = getenv("JSIMD_NOHUFFENC"); data/libjpeg-turbo-2.0.5/tjunittest.c:43:9: [3] (random) random: This function is not sufficiently random for security-related functions such as key and nonce creation (CWE-327). Use a more secure technique for acquiring random values. #define random() rand() data/libjpeg-turbo-2.0.5/tjunittest.c:619:15: [3] (random) random: This function is not sufficiently random for security-related functions such as key and nonce creation (CWE-327). Use a more secure technique for acquiring random values. if (random() < RAND_MAX / 2) srcBuf[i] = 0; data/libjpeg-turbo-2.0.5/tjunittest.c:646:15: [3] (random) random: This function is not sufficiently random for security-related functions such as key and nonce creation (CWE-327). Use a more secure technique for acquiring random values. if (random() < RAND_MAX / 2) srcBuf[i] = 0; data/libjpeg-turbo-2.0.5/tjunittest.c:891:3: [3] (random) srand: This function is not sufficiently random for security-related functions such as key and nonce creation (CWE-327). Use a more secure technique for acquiring random values. srand((unsigned int)time(NULL)); data/libjpeg-turbo-2.0.5/turbojpeg.c:250:14: [3] (buffer) getenv: Environment variables are untrustable input if they can be set by an attacker. They can have any content and length, and the same variable can be set more than once (CWE-807, CWE-20). Check environment variables carefully before using them. if ((env = getenv("TJ_OPTIMIZE")) != NULL && strlen(env) > 0 && data/libjpeg-turbo-2.0.5/turbojpeg.c:253:14: [3] (buffer) getenv: Environment variables are untrustable input if they can be set by an attacker. They can have any content and length, and the same variable can be set more than once (CWE-807, CWE-20). Check environment variables carefully before using them. if ((env = getenv("TJ_ARITHMETIC")) != NULL && strlen(env) > 0 && data/libjpeg-turbo-2.0.5/turbojpeg.c:256:14: [3] (buffer) getenv: Environment variables are untrustable input if they can be set by an attacker. They can have any content and length, and the same variable can be set more than once (CWE-807, CWE-20). Check environment variables carefully before using them. if ((env = getenv("TJ_RESTART")) != NULL && strlen(env) > 0) { data/libjpeg-turbo-2.0.5/turbojpeg.c:288: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. else if ((env = getenv("TJ_PROGRESSIVE")) != NULL && strlen(env) > 0 && data/libjpeg-turbo-2.0.5/cjpeg.c:584: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/libjpeg-turbo-2.0.5/cjpeg.c:595: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/libjpeg-turbo-2.0.5/cjpeg.c:605:21: [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 ((icc_file = fopen(icc_filename, READ_BINARY)) == NULL) { data/libjpeg-turbo-2.0.5/debian/extra/jpegexiforient.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. static unsigned char exif_data[65536L]; data/libjpeg-turbo-2.0.5/debian/extra/jpegexiforient.c:145: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 ((myfile = fopen(argv[i], "rb+")) == NULL) { data/libjpeg-turbo-2.0.5/debian/extra/jpegexiforient.c:150: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 ((myfile = fopen(argv[i], "rb")) == NULL) { data/libjpeg-turbo-2.0.5/djpeg.c:329: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 ((mapfile = fopen(argv[argn], READ_BINARY)) == NULL) { data/libjpeg-turbo-2.0.5/djpeg.c:586: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/libjpeg-turbo-2.0.5/djpeg.c:597: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/libjpeg-turbo-2.0.5/djpeg.c:780:21: [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 ((icc_file = fopen(icc_filename, WRITE_BINARY)) == NULL) { data/libjpeg-turbo-2.0.5/jcarith.c:47: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 *dc_stats[NUM_ARITH_TBLS]; data/libjpeg-turbo-2.0.5/jcarith.c:48: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 *ac_stats[NUM_ARITH_TBLS]; data/libjpeg-turbo-2.0.5/jcarith.c:51: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 fixed_bin[4]; data/libjpeg-turbo-2.0.5/jchuff.c:227: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/libjpeg-turbo-2.0.5/jchuff.h:32: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/libjpeg-turbo-2.0.5/jcmarker.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 dc_in_use[NUM_ARITH_TBLS]; data/libjpeg-turbo-2.0.5/jcmarker.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 ac_in_use[NUM_ARITH_TBLS]; data/libjpeg-turbo-2.0.5/jcstest.c:44:8: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. static char lasterror[JMSG_LENGTH_MAX] = "No error"; data/libjpeg-turbo-2.0.5/jdarith.c:47: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 *dc_stats[NUM_ARITH_TBLS]; data/libjpeg-turbo-2.0.5/jdarith.c:48: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 *ac_stats[NUM_ARITH_TBLS]; data/libjpeg-turbo-2.0.5/jdarith.c:51: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 fixed_bin[4]; data/libjpeg-turbo-2.0.5/jdhuff.c:165: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/libjpeg-turbo-2.0.5/jdicc.c:83: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 marker_present[MAX_SEQ_NO + 1]; /* 1 if marker found */ data/libjpeg-turbo-2.0.5/jerror.c:99: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/libjpeg-turbo-2.0.5/jinclude.h:67:3: [2] (buffer) bcopy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. bcopy((const void *)(src), (void *)(dest), (size_t)(size)) data/libjpeg-turbo-2.0.5/jinclude.h:75: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((void *)(dest), (const void *)(src), (size_t)(size)) data/libjpeg-turbo-2.0.5/jmemsys.h:136: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/libjpeg-turbo-2.0.5/jmemsys.h:142: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/libjpeg-turbo-2.0.5/jmemsys.h:146: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/libjpeg-turbo-2.0.5/jpeg_nbits_table.h:1:23: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. static const unsigned char jpeg_nbits_table[65536] = { data/libjpeg-turbo-2.0.5/jpeglib.h:740: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/libjpeg-turbo-2.0.5/jpegtran.c:456: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[file_index], READ_BINARY)) == NULL) { data/libjpeg-turbo-2.0.5/jpegtran.c:467:21: [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 ((icc_file = fopen(icc_filename, READ_BINARY)) == NULL) { data/libjpeg-turbo-2.0.5/jpegtran.c:549: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(outfilename, WRITE_BINARY)) == NULL) { data/libjpeg-turbo-2.0.5/md5/md5.c:106: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(p, buf, len); data/libjpeg-turbo-2.0.5/md5/md5.c:109: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(p, buf, t); data/libjpeg-turbo-2.0.5/md5/md5.c:118: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(ctx->in, buf, 64); data/libjpeg-turbo-2.0.5/md5/md5.c:127: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(ctx->in, buf, len); data/libjpeg-turbo-2.0.5/md5/md5.c:134:24: [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. void MD5Final(unsigned char digest[16], struct MD5Context *ctx) data/libjpeg-turbo-2.0.5/md5/md5.c:172: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(digest, ctx->buf, 16); data/libjpeg-turbo-2.0.5/md5/md5.h:46: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 in[64]; data/libjpeg-turbo-2.0.5/md5/md5.h:52:31: [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 void MD5Final(unsigned char digest[16], struct MD5Context *ctx); data/libjpeg-turbo-2.0.5/md5/md5hl.c:62: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 digest[LENGTH]; data/libjpeg-turbo-2.0.5/md5/md5hl.c:85: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 buffer[BUFSIZ]; data/libjpeg-turbo-2.0.5/md5/md5hl.c:95:7: [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). f = open(filename, O_RDONLY); data/libjpeg-turbo-2.0.5/rdjpgcom.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/libjpeg-turbo-2.0.5/rdswitch.c:97: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/libjpeg-turbo-2.0.5/rdswitch.c:195: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/libjpeg-turbo-2.0.5/simd/arm/jsimd.c:78:8: [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). fd = fopen("/proc/cpuinfo", "r"); data/libjpeg-turbo-2.0.5/simd/arm64/jsimd.c:81:8: [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). fd = fopen("/proc/cpuinfo", "r"); data/libjpeg-turbo-2.0.5/simd/mips/jsimd.c:38: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 cpuinfo_line[256]; data/libjpeg-turbo-2.0.5/simd/mips/jsimd.c:43: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). if ((f = fopen(file_name, "r")) != NULL) { data/libjpeg-turbo-2.0.5/simd/powerpc/jccolext-altivec.c:36: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 __attribute__((aligned(16))) tmpbuf[RGB_PIXELSIZE * 16]; data/libjpeg-turbo-2.0.5/simd/powerpc/jccolext-altivec.c:93:11: [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(tmpbuf, inptr, min(num_cols, RGB_PIXELSIZE * 16)); data/libjpeg-turbo-2.0.5/simd/powerpc/jccolext-altivec.c:125:11: [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(tmpbuf, inptr, min(num_cols, RGB_PIXELSIZE * 16)); data/libjpeg-turbo-2.0.5/simd/powerpc/jcgryext-altivec.c:35: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 __attribute__((aligned(16))) tmpbuf[RGB_PIXELSIZE * 16]; data/libjpeg-turbo-2.0.5/simd/powerpc/jcgryext-altivec.c:87:11: [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(tmpbuf, inptr, min(num_cols, RGB_PIXELSIZE * 16)); data/libjpeg-turbo-2.0.5/simd/powerpc/jcgryext-altivec.c:118:11: [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(tmpbuf, inptr, min(num_cols, RGB_PIXELSIZE * 16)); data/libjpeg-turbo-2.0.5/simd/powerpc/jdcolext-altivec.c:35: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 __attribute__((aligned(16))) tmpbuf[RGB_PIXELSIZE * 16]; data/libjpeg-turbo-2.0.5/simd/powerpc/jdcolext-altivec.c:219:11: [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(outptr, tmpbuf, min(num_cols, RGB_PIXELSIZE * 16)); data/libjpeg-turbo-2.0.5/simd/powerpc/jdcolext-altivec.c:258:11: [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(outptr, tmpbuf, min(num_cols, RGB_PIXELSIZE * 16)); data/libjpeg-turbo-2.0.5/simd/powerpc/jdmrgext-altivec.c:36: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 __attribute__((aligned(16))) tmpbuf[RGB_PIXELSIZE * 16]; data/libjpeg-turbo-2.0.5/simd/powerpc/jdmrgext-altivec.c:248:11: [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(outptr, tmpbuf, min(num_cols, RGB_PIXELSIZE * 16)); data/libjpeg-turbo-2.0.5/simd/powerpc/jdmrgext-altivec.c:287:11: [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(outptr, tmpbuf, min(num_cols, RGB_PIXELSIZE * 16)); data/libjpeg-turbo-2.0.5/simd/powerpc/jsimd.c:86:8: [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). fd = fopen("/proc/cpuinfo", "r"); data/libjpeg-turbo-2.0.5/tjbench.c:47: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 tjErrorStr[JMSG_LENGTH_MAX] = "\0", tjErrorMsg[JMSG_LENGTH_MAX] = "\0"; data/libjpeg-turbo-2.0.5/tjbench.c:81:7: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. const char *pixFormatStr[TJ_NUMPF] = { data/libjpeg-turbo-2.0.5/tjbench.c:84:7: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. const char *subNameLong[TJ_NUMSAMP] = { data/libjpeg-turbo-2.0.5/tjbench.c:87:7: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. const char *csName[TJ_NUMCS] = { data/libjpeg-turbo-2.0.5/tjbench.c:90:7: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. const char *subName[TJ_NUMSAMP] = { data/libjpeg-turbo-2.0.5/tjbench.c:102:13: [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. return (char *)subNameLong[subsamp]; data/libjpeg-turbo-2.0.5/tjbench.c:107:13: [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. return (char *)csName[cs]; data/libjpeg-turbo-2.0.5/tjbench.c:113: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 format[80]; data/libjpeg-turbo-2.0.5/tjbench.c:144: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 tempStr[1024], sizeStr[24] = "\0", qualStr[13] = "\0", *ptr; data/libjpeg-turbo-2.0.5/tjbench.c:316: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 tempStr[1024], tempStr2[80]; data/libjpeg-turbo-2.0.5/tjbench.c:371: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(&tmpBuf[pitch * i], &srcBuf[w * ps * i], w * ps); data/libjpeg-turbo-2.0.5/tjbench.c:476: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 ((file = fopen(tempStr, "wb")) == NULL) data/libjpeg-turbo-2.0.5/tjbench.c:535: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 ((file = fopen(fileName, "rb")) == NULL) data/libjpeg-turbo-2.0.5/tjbench.c:836:20: [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). if ((minQual = atoi(argv[2])) < 1 || minQual > 100) { data/libjpeg-turbo-2.0.5/tjbench.c:937:21: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). int tempi = atoi(argv[++i]); data/libjpeg-turbo-2.0.5/tjbench.c:944:23: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). int tempi = atoi(argv[i]); data/libjpeg-turbo-2.0.5/tjexample.c:60:7: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. const char *subsampName[TJ_NUMSAMP] = { data/libjpeg-turbo-2.0.5/tjexample.c:64:7: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. const char *colorspaceName[TJ_NUMCS] = { data/libjpeg-turbo-2.0.5/tjexample.c:211:17: [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). outQual = atoi(argv[++i]); data/libjpeg-turbo-2.0.5/tjexample.c:268:21: [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 ((jpegFile = fopen(argv[1], "rb")) == NULL) data/libjpeg-turbo-2.0.5/tjexample.c:314: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 ((jpegFile = fopen(argv[2], "wb")) == NULL) data/libjpeg-turbo-2.0.5/tjexample.c:331:29: [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 ((imgBuf = (unsigned char *)tjAlloc(width * height * data/libjpeg-turbo-2.0.5/tjexample.c:375:21: [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 ((jpegFile = fopen(argv[2], "wb")) == NULL) data/libjpeg-turbo-2.0.5/tjunittest.c:74:7: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. const char *subNameLong[TJ_NUMSAMP] = { data/libjpeg-turbo-2.0.5/tjunittest.c:77:7: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. const char *subName[TJ_NUMSAMP] = { data/libjpeg-turbo-2.0.5/tjunittest.c:81:7: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. const char *pixFormatStr[TJ_NUMPF] = { data/libjpeg-turbo-2.0.5/tjunittest.c:348:16: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). FILE *file = fopen(filename, "wb"); data/libjpeg-turbo-2.0.5/tjunittest.c:364: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 tempStr[1024]; data/libjpeg-turbo-2.0.5/tjunittest.c:371:27: [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 ((srcBuf = (unsigned char *)malloc(w * h * tjPixelSize[pf])) == NULL) data/libjpeg-turbo-2.0.5/tjunittest.c:762: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 filename[80], *md5sum, md5buf[65]; data/libjpeg-turbo-2.0.5/turbojpeg-jni.c:329:18: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. const unsigned char *srcPlanes[3]; data/libjpeg-turbo-2.0.5/turbojpeg-jni.c:923:18: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. const unsigned char *srcPlanes[3]; data/libjpeg-turbo-2.0.5/turbojpeg.c:59:21: [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 THREAD_LOCAL char errStr[JMSG_LENGTH_MAX] = "No error"; data/libjpeg-turbo-2.0.5/turbojpeg.c:111: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 errStr[JMSG_LENGTH_MAX]; data/libjpeg-turbo-2.0.5/turbojpeg.c:450:19: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. static unsigned char buffer[1]; data/libjpeg-turbo-2.0.5/turbojpeg.c:817:19: [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 *)PAD((size_t)_tmpbuf[i], 32); data/libjpeg-turbo-2.0.5/turbojpeg.c:833:19: [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 *)PAD((size_t)_tmpbuf2[i], 32); data/libjpeg-turbo-2.0.5/turbojpeg.c:888: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 *dstPlanes[3]; data/libjpeg-turbo-2.0.5/turbojpeg.c:1047:11: [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(tmpbuf[i][j], inbuf[i][crow[i] + j], pw[i]); data/libjpeg-turbo-2.0.5/turbojpeg.c:1054:11: [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(tmpbuf[i][j], tmpbuf[i][ph[i] - crow[i] - 1], iw[i]); data/libjpeg-turbo-2.0.5/turbojpeg.c:1081:18: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. const unsigned char *srcPlanes[3]; data/libjpeg-turbo-2.0.5/turbojpeg.c:1120:19: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. static unsigned char buffer[1]; data/libjpeg-turbo-2.0.5/turbojpeg.c:1485:19: [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 *)PAD((size_t)_tmpbuf[i], 32); data/libjpeg-turbo-2.0.5/turbojpeg.c:1539:18: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. const unsigned char *srcPlanes[3]; data/libjpeg-turbo-2.0.5/turbojpeg.c:1725:11: [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(outbuf[i][crow[i] + j], tmpbuf[i][j], pw[i]); data/libjpeg-turbo-2.0.5/turbojpeg.c:1748: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 *dstPlanes[3]; data/libjpeg-turbo-2.0.5/turbojpeg.c:2014: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 ((file = fopen(filename, "rb")) == NULL) data/libjpeg-turbo-2.0.5/turbojpeg.c:2068: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(dstptr, src->buffer[i], (*width) * tjPixelSize[*pixelFormat]); data/libjpeg-turbo-2.0.5/turbojpeg.c:2105: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 ((file = fopen(filename, "wb")) == NULL) data/libjpeg-turbo-2.0.5/turbojpeg.c:2142: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(dst->buffer[0], rowptr, width * tjPixelSize[pixelFormat]); data/libjpeg-turbo-2.0.5/wrbmp.c:221: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/libjpeg-turbo-2.0.5/wrbmp.c:222: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/libjpeg-turbo-2.0.5/wrbmp.c:300: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/libjpeg-turbo-2.0.5/wrbmp.c:301: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/libjpeg-turbo-2.0.5/wrgif.c:68: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/libjpeg-turbo-2.0.5/wrjpgcom.c:436: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/libjpeg-turbo-2.0.5/wrjpgcom.c:494: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/libjpeg-turbo-2.0.5/wrjpgcom.c:520: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/libjpeg-turbo-2.0.5/wrrle.c:181: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/libjpeg-turbo-2.0.5/wrrle.c:205: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", data/libjpeg-turbo-2.0.5/wrtarga.c:51: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/libjpeg-turbo-2.0.5/cjpeg.c:102: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/libjpeg-turbo-2.0.5/debian/extra/jpegexiforient.c:46:21: [1] (buffer) getc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). #define NEXTBYTE() getc(myfile) data/libjpeg-turbo-2.0.5/jerror.h:257: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/libjpeg-turbo-2.0.5/jerror.h:313: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/libjpeg-turbo-2.0.5/md5/md5cmp.c:43: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). if (strlen(argv[1]) != 32) data/libjpeg-turbo-2.0.5/md5/md5hl.c:45:9: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). #define read _read data/libjpeg-turbo-2.0.5/md5/md5hl.c:111:11: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). i = read(f, buffer, sizeof(buffer)); data/libjpeg-turbo-2.0.5/md5/md5hl.c:113:11: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). i = read(f, buffer, n); data/libjpeg-turbo-2.0.5/rdbmp.c:97: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/libjpeg-turbo-2.0.5/rdcolmap.c:89: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/libjpeg-turbo-2.0.5/rdcolmap.c:105:9: [1] (buffer) getc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). R = getc(infile); data/libjpeg-turbo-2.0.5/rdcolmap.c:106:9: [1] (buffer) getc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). G = getc(infile); data/libjpeg-turbo-2.0.5/rdcolmap.c:107:9: [1] (buffer) getc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). B = getc(infile); data/libjpeg-turbo-2.0.5/rdcolmap.c:128:8: [1] (buffer) getc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). ch = getc(infile); data/libjpeg-turbo-2.0.5/rdcolmap.c:131:12: [1] (buffer) getc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). ch = getc(infile); data/libjpeg-turbo-2.0.5/rdcolmap.c:179: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/libjpeg-turbo-2.0.5/rdcolmap.c:208:13: [1] (buffer) getc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). R = getc(infile); data/libjpeg-turbo-2.0.5/rdcolmap.c:209:13: [1] (buffer) getc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). G = getc(infile); data/libjpeg-turbo-2.0.5/rdcolmap.c:210:13: [1] (buffer) getc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). B = getc(infile); data/libjpeg-turbo-2.0.5/rdcolmap.c:241:11: [1] (buffer) getc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). switch (getc(infile)) { data/libjpeg-turbo-2.0.5/rdjpgcom.c:63:21: [1] (buffer) getc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). #define NEXTBYTE() getc(infile) data/libjpeg-turbo-2.0.5/rdppm.c:91:8: [1] (buffer) getc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). ch = getc(infile); data/libjpeg-turbo-2.0.5/rdppm.c:94:12: [1] (buffer) getc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). ch = getc(infile); data/libjpeg-turbo-2.0.5/rdppm.c:568: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/libjpeg-turbo-2.0.5/rdppm.c:571: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/libjpeg-turbo-2.0.5/rdswitch.c:31:8: [1] (buffer) getc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). ch = getc(file); data/libjpeg-turbo-2.0.5/rdswitch.c:34:12: [1] (buffer) getc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). ch = getc(file); data/libjpeg-turbo-2.0.5/rdtarga.c:99: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/libjpeg-turbo-2.0.5/simd/arm/jsimd.c:57:10: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). p += strlen(feature); data/libjpeg-turbo-2.0.5/simd/arm64/jsimd.c:50:30: [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(buffer, field, strlen(field)) != 0) data/libjpeg-turbo-2.0.5/simd/arm64/jsimd.c:52: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). buffer += strlen(field); data/libjpeg-turbo-2.0.5/simd/arm64/jsimd.c:62:10: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). p += strlen(value); data/libjpeg-turbo-2.0.5/simd/powerpc/jsimd.c:65:10: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). p += strlen(feature); data/libjpeg-turbo-2.0.5/tjbench.c:64:7: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(tjErrorStr, _tjErrorStr, JMSG_LENGTH_MAX - 1); \ data/libjpeg-turbo-2.0.5/tjbench.c:65:7: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(tjErrorMsg, m, JMSG_LENGTH_MAX - 1); \ data/libjpeg-turbo-2.0.5/tjbench.c:840:50: [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 ((temp = strchr(argv[2], '-')) != NULL && strlen(temp) > 1 && data/libjpeg-turbo-2.0.5/tjexample.c:253: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 (inFormat == NULL || outFormat == NULL || strlen(inFormat) < 2 || data/libjpeg-turbo-2.0.5/tjexample.c:254: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). strlen(outFormat) < 2) data/libjpeg-turbo-2.0.5/turbojpeg.c:250: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 ((env = getenv("TJ_OPTIMIZE")) != NULL && strlen(env) > 0 && data/libjpeg-turbo-2.0.5/turbojpeg.c:253:50: [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 ((env = getenv("TJ_ARITHMETIC")) != NULL && strlen(env) > 0 && data/libjpeg-turbo-2.0.5/turbojpeg.c:256:47: [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 ((env = getenv("TJ_RESTART")) != NULL && strlen(env) > 0) { data/libjpeg-turbo-2.0.5/turbojpeg.c:288:56: [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). else if ((env = getenv("TJ_PROGRESSIVE")) != NULL && strlen(env) > 0 && data/libjpeg-turbo-2.0.5/turbojpeg.c:2017:16: [1] (buffer) getc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if ((tempc = getc(file)) < 0 || ungetc(tempc, file) == EOF) data/libjpeg-turbo-2.0.5/wrjpgcom.c:72:21: [1] (buffer) getc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). #define NEXTBYTE() getc(infile) data/libjpeg-turbo-2.0.5/wrjpgcom.c:450: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(argv[argn]) + 2 >= (size_t)MAX_COM_LENGTH) { data/libjpeg-turbo-2.0.5/wrjpgcom.c:457:42: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). comment_length = (unsigned int)strlen(comment_arg); data/libjpeg-turbo-2.0.5/wrjpgcom.c:464:15: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (strlen(comment_arg) + strlen(argv[argn]) + 2 >= data/libjpeg-turbo-2.0.5/wrjpgcom.c:464:37: [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(comment_arg) + strlen(argv[argn]) + 2 >= data/libjpeg-turbo-2.0.5/wrjpgcom.c:470:11: [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/libjpeg-turbo-2.0.5/wrjpgcom.c:473:18: [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). } else if (strlen(argv[argn]) >= (size_t)MAX_COM_LENGTH) { data/libjpeg-turbo-2.0.5/wrjpgcom.c:478: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). comment_length = (unsigned int)strlen(comment_arg); data/libjpeg-turbo-2.0.5/wrjpgcom.c:554: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 = 218 Lines analyzed = 72712 in approximately 2.31 seconds (31536 lines/second) Physical Source Lines of Code (SLOC) = 49115 Hits@level = [0] 564 [1] 52 [2] 126 [3] 34 [4] 6 [5] 0 Hits@level+ = [0+] 782 [1+] 218 [2+] 166 [3+] 40 [4+] 6 [5+] 0 Hits/KSLOC@level+ = [0+] 15.9218 [1+] 4.43856 [2+] 3.37982 [3+] 0.814415 [4+] 0.122162 [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.