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/exifprobe-2.0.1+git20170416.3c2b769/maker_kyocera.c Examining data/exifprobe-2.0.1+git20170416.3c2b769/raf.h Examining data/exifprobe-2.0.1+git20170416.3c2b769/jpegtags.h Examining data/exifprobe-2.0.1+git20170416.3c2b769/maker_sony.c Examining data/exifprobe-2.0.1+git20170416.3c2b769/maker_toshiba.c Examining data/exifprobe-2.0.1+git20170416.3c2b769/ricoh_datadefs.h Examining data/exifprobe-2.0.1+git20170416.3c2b769/fujifilm_datadefs.h Examining data/exifprobe-2.0.1+git20170416.3c2b769/global.h Examining data/exifprobe-2.0.1+git20170416.3c2b769/canon_extern.h Examining data/exifprobe-2.0.1+git20170416.3c2b769/jp2_datadefs.h Examining data/exifprobe-2.0.1+git20170416.3c2b769/kodak_datadefs.h Examining data/exifprobe-2.0.1+git20170416.3c2b769/maker_kodak.c Examining data/exifprobe-2.0.1+git20170416.3c2b769/mrw.h Examining data/exifprobe-2.0.1+git20170416.3c2b769/hp_datadefs.h Examining data/exifprobe-2.0.1+git20170416.3c2b769/nikon_datadefs.h Examining data/exifprobe-2.0.1+git20170416.3c2b769/private_tags.h Examining data/exifprobe-2.0.1+git20170416.3c2b769/leica_datadefs.h Examining data/exifprobe-2.0.1+git20170416.3c2b769/maker_tagnames.c Examining data/exifprobe-2.0.1+git20170416.3c2b769/maker_canon.c Examining data/exifprobe-2.0.1+git20170416.3c2b769/x3f_extern.h Examining data/exifprobe-2.0.1+git20170416.3c2b769/maker_konica.c Examining data/exifprobe-2.0.1+git20170416.3c2b769/mrw.c Examining data/exifprobe-2.0.1+git20170416.3c2b769/interpret.c Examining data/exifprobe-2.0.1+git20170416.3c2b769/exiftags.h Examining data/exifprobe-2.0.1+git20170416.3c2b769/win/byteorder.h Examining data/exifprobe-2.0.1+git20170416.3c2b769/win/snprintf.c Examining data/exifprobe-2.0.1+git20170416.3c2b769/win/comptime.c Examining data/exifprobe-2.0.1+git20170416.3c2b769/win/unistd.h Examining data/exifprobe-2.0.1+git20170416.3c2b769/win/getopt.h Examining data/exifprobe-2.0.1+git20170416.3c2b769/win/getopt.c Examining data/exifprobe-2.0.1+git20170416.3c2b769/maker_panasonic.c Examining data/exifprobe-2.0.1+git20170416.3c2b769/summary.h Examining data/exifprobe-2.0.1+git20170416.3c2b769/ciff_datadefs.h Examining data/exifprobe-2.0.1+git20170416.3c2b769/x3f_datadefs.h Examining data/exifprobe-2.0.1+git20170416.3c2b769/lib/veclib.c Examining data/exifprobe-2.0.1+git20170416.3c2b769/print_maker.c Examining data/exifprobe-2.0.1+git20170416.3c2b769/maker_fujifilm.c Examining data/exifprobe-2.0.1+git20170416.3c2b769/mrw_extern.h Examining data/exifprobe-2.0.1+git20170416.3c2b769/toshiba_datadefs.h Examining data/exifprobe-2.0.1+git20170416.3c2b769/tiffeptags.h Examining data/exifprobe-2.0.1+git20170416.3c2b769/x3f.c Examining data/exifprobe-2.0.1+git20170416.3c2b769/sigma_datadefs.h Examining data/exifprobe-2.0.1+git20170416.3c2b769/maker.h Examining data/exifprobe-2.0.1+git20170416.3c2b769/tags.h Examining data/exifprobe-2.0.1+git20170416.3c2b769/aux/extract_section.c Examining data/exifprobe-2.0.1+git20170416.3c2b769/aux/findjpeg.c Examining data/exifprobe-2.0.1+git20170416.3c2b769/aux/dump_section.c Examining data/exifprobe-2.0.1+git20170416.3c2b769/konica_datadefs.h Examining data/exifprobe-2.0.1+git20170416.3c2b769/raf.c Examining data/exifprobe-2.0.1+git20170416.3c2b769/extern.h Examining data/exifprobe-2.0.1+git20170416.3c2b769/agfa_datadefs.h Examining data/exifprobe-2.0.1+git20170416.3c2b769/jp2tags.h Examining data/exifprobe-2.0.1+git20170416.3c2b769/dngtags.h Examining data/exifprobe-2.0.1+git20170416.3c2b769/process.c Examining data/exifprobe-2.0.1+git20170416.3c2b769/misc.h Examining data/exifprobe-2.0.1+git20170416.3c2b769/tifftags.h Examining data/exifprobe-2.0.1+git20170416.3c2b769/kyocera_datadefs.h Examining data/exifprobe-2.0.1+git20170416.3c2b769/main.c Examining data/exifprobe-2.0.1+git20170416.3c2b769/maker_casio.c Examining data/exifprobe-2.0.1+git20170416.3c2b769/olympus_datadefs.h Examining data/exifprobe-2.0.1+git20170416.3c2b769/epson_datadefs.h Examining data/exifprobe-2.0.1+git20170416.3c2b769/datadefs.h Examining data/exifprobe-2.0.1+git20170416.3c2b769/panasonic_datadefs.h Examining data/exifprobe-2.0.1+git20170416.3c2b769/maker_nikon.c Examining data/exifprobe-2.0.1+git20170416.3c2b769/jp2_extern.h Examining data/exifprobe-2.0.1+git20170416.3c2b769/mrw_datadefs.h Examining data/exifprobe-2.0.1+git20170416.3c2b769/pentax_datadefs.h Examining data/exifprobe-2.0.1+git20170416.3c2b769/minolta_datadefs.h Examining data/exifprobe-2.0.1+git20170416.3c2b769/ciff_extern.h Examining data/exifprobe-2.0.1+git20170416.3c2b769/ciff.h Examining data/exifprobe-2.0.1+git20170416.3c2b769/maker_generic.c Examining data/exifprobe-2.0.1+git20170416.3c2b769/maker_sigma.c Examining data/exifprobe-2.0.1+git20170416.3c2b769/defs.h Examining data/exifprobe-2.0.1+git20170416.3c2b769/maker_hp.c Examining data/exifprobe-2.0.1+git20170416.3c2b769/sony_datadefs.h Examining data/exifprobe-2.0.1+git20170416.3c2b769/maker_leica.c Examining data/exifprobe-2.0.1+git20170416.3c2b769/maker_asahi.c Examining data/exifprobe-2.0.1+git20170416.3c2b769/maker_extern.h Examining data/exifprobe-2.0.1+git20170416.3c2b769/maker_ricoh.c Examining data/exifprobe-2.0.1+git20170416.3c2b769/version.h Examining data/exifprobe-2.0.1+git20170416.3c2b769/maker_datadefs.h Examining data/exifprobe-2.0.1+git20170416.3c2b769/x3f.h Examining data/exifprobe-2.0.1+git20170416.3c2b769/sanyo_datadefs.h Examining data/exifprobe-2.0.1+git20170416.3c2b769/casio_datadefs.h Examining data/exifprobe-2.0.1+git20170416.3c2b769/cifftags.h Examining data/exifprobe-2.0.1+git20170416.3c2b769/canon_datadefs.h Examining data/exifprobe-2.0.1+git20170416.3c2b769/jp2.h Examining data/exifprobe-2.0.1+git20170416.3c2b769/maker_traveler.c Examining data/exifprobe-2.0.1+git20170416.3c2b769/traveler_datadefs.h Examining data/exifprobe-2.0.1+git20170416.3c2b769/camera_names.h Examining data/exifprobe-2.0.1+git20170416.3c2b769/ciff.c Examining data/exifprobe-2.0.1+git20170416.3c2b769/jp2000.c Examining data/exifprobe-2.0.1+git20170416.3c2b769/options.c Examining data/exifprobe-2.0.1+git20170416.3c2b769/print.c Examining data/exifprobe-2.0.1+git20170416.3c2b769/readfile.c Examining data/exifprobe-2.0.1+git20170416.3c2b769/tagnames.c Examining data/exifprobe-2.0.1+git20170416.3c2b769/maker_agfa.c Examining data/exifprobe-2.0.1+git20170416.3c2b769/maker_epson.c Examining data/exifprobe-2.0.1+git20170416.3c2b769/maker_minolta.c Examining data/exifprobe-2.0.1+git20170416.3c2b769/maker_olympus.c Examining data/exifprobe-2.0.1+git20170416.3c2b769/maker_sanyo.c Examining data/exifprobe-2.0.1+git20170416.3c2b769/misc.c Examining data/exifprobe-2.0.1+git20170416.3c2b769/byteorder.h FINAL RESULTS: data/exifprobe-2.0.1+git20170416.3c2b769/aux/dump_section.c:383:13: [4] (format) printf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. printf(strerror(errno)); data/exifprobe-2.0.1+git20170416.3c2b769/aux/dump_section.c:425:13: [4] (format) printf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. printf(strerror(errno)); data/exifprobe-2.0.1+git20170416.3c2b769/options.c:255:9: [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(argstr, envopts); data/exifprobe-2.0.1+git20170416.3c2b769/win/snprintf.c:4:5: [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. int snprintf(char *buffer, size_t count, const char *format, ...) data/exifprobe-2.0.1+git20170416.3c2b769/win/snprintf.c:9:11: [4] (format) vsnprintf: If format strings can be influenced by an attacker, they can be exploited, and note that sprintf variations do not always \0-terminate (CWE-134). Use a constant for the format specification. len = vsnprintf(buffer, count, format, args); data/exifprobe-2.0.1+git20170416.3c2b769/extern.h:18:12: [3] (buffer) getopt: Some older implementations do not protect against internal buffer overflows (CWE-120, CWE-20). Check implementation on installation, or limit the size of all string inputs. extern int getopt(); data/exifprobe-2.0.1+git20170416.3c2b769/options.c:41:18: [3] (buffer) getopt: Some older implementations do not protect against internal buffer overflows (CWE-120, CWE-20). Check implementation on installation, or limit the size of all string inputs. while((opt = getopt(argc,argv,"ace:hil:m:np:s:tuA:B:C:DILM:N:O:RSU:VXY:Z")) != EOF) data/exifprobe-2.0.1+git20170416.3c2b769/options.c:250: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. envopts = getenv("EXIFPROBE_OPTIONS"); data/exifprobe-2.0.1+git20170416.3c2b769/win/getopt.c:60:1: [3] (buffer) getopt: Some older implementations do not protect against internal buffer overflows (CWE-120, CWE-20). Check implementation on installation, or limit the size of all string inputs. getopt(int nargc, char * const nargv[], const char *ostr) data/exifprobe-2.0.1+git20170416.3c2b769/win/getopt.h:17:5: [3] (buffer) getopt: Some older implementations do not protect against internal buffer overflows (CWE-120, CWE-20). Check implementation on installation, or limit the size of all string inputs. int getopt(int nargc, char * const nargv[], const char *ostr); data/exifprobe-2.0.1+git20170416.3c2b769/aux/dump_section.c:175: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((ifp = fopen(infilename,"r")) != (FILE *)0) data/exifprobe-2.0.1+git20170416.3c2b769/aux/dump_section.c:357:14: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. unsigned char rbuf[2]; data/exifprobe-2.0.1+git20170416.3c2b769/aux/dump_section.c:399:14: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. unsigned char rbuf[4]; data/exifprobe-2.0.1+git20170416.3c2b769/aux/extract_section.c:36: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 copybuf[COPYBUFSIZE]; data/exifprobe-2.0.1+git20170416.3c2b769/aux/extract_section.c:37: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 outfilename[NAMELENGTH]; data/exifprobe-2.0.1+git20170416.3c2b769/aux/extract_section.c:99: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((ifp = fopen(infilename,"r")) != (FILE *)0) data/exifprobe-2.0.1+git20170416.3c2b769/aux/extract_section.c:101: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((ofp = fopen(outfilename,"w")) == (FILE *)0) data/exifprobe-2.0.1+git20170416.3c2b769/aux/findjpeg.c:91:14: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). if((fp = fopen(filename,"r")) != (FILE *)0) data/exifprobe-2.0.1+git20170416.3c2b769/ciff_datadefs.h:20: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 type[5]; data/exifprobe-2.0.1+git20170416.3c2b769/ciff_datadefs.h:21: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 subtype[5]; data/exifprobe-2.0.1+git20170416.3c2b769/main.c:86: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). inptr = fopen(file,"rb"); data/exifprobe-2.0.1+git20170416.3c2b769/maker_generic.c:1181:9: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(&(maker_scheme.first_entry),ifdentry,sizeof(struct ifd_entry)); data/exifprobe-2.0.1+git20170416.3c2b769/maker_generic.c:1512: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. static char buffer[MAX_IDLEN]; data/exifprobe-2.0.1+git20170416.3c2b769/maker_tagnames.c:50: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. static char unknown_buf[16]; data/exifprobe-2.0.1+git20170416.3c2b769/misc.c:1308: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 splicebuf[1024]; data/exifprobe-2.0.1+git20170416.3c2b769/options.c:169:34: [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). nv = atoi(optarg); data/exifprobe-2.0.1+git20170416.3c2b769/options.c:246: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 *argv[MAXARGV]; data/exifprobe-2.0.1+git20170416.3c2b769/options.c:254:9: [2] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). Risk is low because the source is a constant string. strcpy(argstr, "e "); data/exifprobe-2.0.1+git20170416.3c2b769/print.c:3077: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. static char unknown_buf[16]; data/exifprobe-2.0.1+git20170416.3c2b769/process.c:100: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 dirnamebuf[16]; data/exifprobe-2.0.1+git20170416.3c2b769/process.c:141:17: [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(dirnamebuf,"Ifd%d",ifdnum); data/exifprobe-2.0.1+git20170416.3c2b769/process.c:148:17: [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(dirnamebuf,"SubIfd%d",subifdnum); data/exifprobe-2.0.1+git20170416.3c2b769/readfile.c:275:14: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. unsigned char rbuf[2]; data/exifprobe-2.0.1+git20170416.3c2b769/readfile.c:323:14: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. unsigned char rbuf[1]; data/exifprobe-2.0.1+git20170416.3c2b769/readfile.c:374:14: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. unsigned char rbuf[4]; data/exifprobe-2.0.1+git20170416.3c2b769/readfile.c:434:14: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. unsigned char rbuf[sizeof(double)]; data/exifprobe-2.0.1+git20170416.3c2b769/readfile.c:464:14: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. unsigned char swap[sizeof(long long)]; data/exifprobe-2.0.1+git20170416.3c2b769/readfile.c:495:14: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. unsigned char rbuf[sizeof(double)]; data/exifprobe-2.0.1+git20170416.3c2b769/readfile.c:528: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 unsigned char rbuf[MAXBUFLEN]; data/exifprobe-2.0.1+git20170416.3c2b769/readfile.c:666:14: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. unsigned char swap[sizeof(double)]; data/exifprobe-2.0.1+git20170416.3c2b769/readfile.c:727: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. static char stringbuf[MAXBUFLEN]; data/exifprobe-2.0.1+git20170416.3c2b769/tagnames.c:42: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. static char unknown_buf[16]; data/exifprobe-2.0.1+git20170416.3c2b769/tagnames.c:513: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. static char unknown_buf[16]; data/exifprobe-2.0.1+git20170416.3c2b769/tagnames.c:541: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. static char unknown_buf[16]; data/exifprobe-2.0.1+git20170416.3c2b769/tagnames.c:594: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. static char unknown_buf[16]; data/exifprobe-2.0.1+git20170416.3c2b769/tagnames.c:676: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. static char unknown_buf[16]; data/exifprobe-2.0.1+git20170416.3c2b769/x3f.c:55:17: [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(header.unique_id,bytearray,16); data/exifprobe-2.0.1+git20170416.3c2b769/x3f.c:65:21: [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(header.white_balance,bytearray,32); data/exifprobe-2.0.1+git20170416.3c2b769/x3f.c:68:21: [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(header.extended_data_types,bytearray,32); data/exifprobe-2.0.1+git20170416.3c2b769/x3f.c:71:21: [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(header.extended_data_values,bytearray,128); data/exifprobe-2.0.1+git20170416.3c2b769/x3f_datadefs.h:21: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 unique_id[16]; data/exifprobe-2.0.1+git20170416.3c2b769/x3f_datadefs.h:26: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 white_balance[32]; data/exifprobe-2.0.1+git20170416.3c2b769/x3f_datadefs.h:27: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 extended_data_types[32]; data/exifprobe-2.0.1+git20170416.3c2b769/aux/dump_section.c:187:30: [1] (buffer) fgetc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). svalue = fgetc(ifp); data/exifprobe-2.0.1+git20170416.3c2b769/aux/dump_section.c:205:30: [1] (buffer) fgetc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). svalue = fgetc(ifp); data/exifprobe-2.0.1+git20170416.3c2b769/aux/extract_section.c:78:27: [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(onamelength < (strlen(infilename) + 2)) data/exifprobe-2.0.1+git20170416.3c2b769/aux/findjpeg.c:94:28: [1] (buffer) fgetc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). while(((highbyte = fgetc(fp)) != EOF) && (ftell(fp) <= end_offset)) data/exifprobe-2.0.1+git20170416.3c2b769/aux/findjpeg.c:99:22: [1] (buffer) fgetc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). lobyte = fgetc(fp); data/exifprobe-2.0.1+git20170416.3c2b769/aux/findjpeg.c:109:41: [1] (buffer) fgetc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if(((highbyte = fgetc(fp)) != EOF) && (ftell(fp) <= end_offset)) data/exifprobe-2.0.1+git20170416.3c2b769/aux/findjpeg.c:117:43: [1] (buffer) fgetc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if(((lobyte = fgetc(fp)) != EOF) && (ftell(fp) <= end_offset)) data/exifprobe-2.0.1+git20170416.3c2b769/ciff.c:638:35: [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). entrywidth += strlen(dirname) + 1; data/exifprobe-2.0.1+git20170416.3c2b769/ciff.c:672:31: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). makelen = strlen(makename); data/exifprobe-2.0.1+git20170416.3c2b769/ciff.c:688:83: [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). print_tag_address(ENTRY,entry->offset + fileoffset_base + strlen(Make_name) + 1, data/exifprobe-2.0.1+git20170416.3c2b769/ciff.c:760: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). entrywidth = strlen("TargetCompressionRatio"); data/exifprobe-2.0.1+git20170416.3c2b769/ciff.c:972: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). entrywidth = strlen("TargetCompressionRatio"); data/exifprobe-2.0.1+git20170416.3c2b769/ciff.c:1204: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). entrywidth = strlen("FlashGuideNumber"); data/exifprobe-2.0.1+git20170416.3c2b769/ciff.c:1296:59: [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). tagwidth = CIFFTAGWIDTH - strlen(nameoftag) - 1; data/exifprobe-2.0.1+git20170416.3c2b769/ciff.c:1364:59: [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). tagwidth = CIFFTAGWIDTH - strlen(nameoftag) - 1; data/exifprobe-2.0.1+git20170416.3c2b769/ciff.c:1423:59: [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). tagwidth = CIFFTAGWIDTH - strlen(nameoftag) - 1; data/exifprobe-2.0.1+git20170416.3c2b769/ciff.c:1558:22: [1] (buffer) fgetc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). while(((ch = fgetc(inptr)) != EOF) && (count++ < maxcheck)) data/exifprobe-2.0.1+git20170416.3c2b769/ciff.c:1651:13: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(header.type,(char *)string,4); data/exifprobe-2.0.1+git20170416.3c2b769/ciff.c:1654:17: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(header.subtype,(char *)string,4); data/exifprobe-2.0.1+git20170416.3c2b769/maker_generic.c:179:29: [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). tagwidth -= strlen(nameoftag) + 1; data/exifprobe-2.0.1+git20170416.3c2b769/maker_generic.c:329:44: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). tagwidth = MAKERTAGWIDTH - strlen(nameoftag) - 2; data/exifprobe-2.0.1+git20170416.3c2b769/maker_generic.c:628:33: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). tagwidth -= strlen(nameoftag) - 1; data/exifprobe-2.0.1+git20170416.3c2b769/maker_generic.c:959:24: [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). length_read = id ? strlen(id) : 0; data/exifprobe-2.0.1+git20170416.3c2b769/maker_generic.c:978:17: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). id_length = strlen(id); data/exifprobe-2.0.1+git20170416.3c2b769/options.c:253:31: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). char *argstr = calloc(strlen(envopts) + 3, 1); data/exifprobe-2.0.1+git20170416.3c2b769/print.c:1796:18: [1] (buffer) fgetc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). ch = fgetc(inptr); data/exifprobe-2.0.1+git20170416.3c2b769/print.c:1813:30: [1] (buffer) fgetc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). ch = fgetc(inptr); data/exifprobe-2.0.1+git20170416.3c2b769/print.c:2013:28: [1] (buffer) fgetc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if(fgetc(inptr) != '\0') data/exifprobe-2.0.1+git20170416.3c2b769/print.c:2033:32: [1] (buffer) fgetc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if(fgetc(inptr) != ' ') data/exifprobe-2.0.1+git20170416.3c2b769/print_maker.c:793: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). plen = strlen(pattern); data/exifprobe-2.0.1+git20170416.3c2b769/print_maker.c:798:20: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). slen = strlen(string); data/exifprobe-2.0.1+git20170416.3c2b769/process.c:3336:28: [1] (buffer) fgetc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). while(((highbyte = fgetc(inptr)) != EOF) && (highbyte != EOF) && (ftell(inptr) < end_of_section)) data/exifprobe-2.0.1+git20170416.3c2b769/process.c:3341:22: [1] (buffer) fgetc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). lobyte = fgetc(inptr); data/exifprobe-2.0.1+git20170416.3c2b769/process.c:4391:34: [1] (buffer) fgetc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). nextch = fgetc(inptr); data/exifprobe-2.0.1+git20170416.3c2b769/process.c:4427:64: [1] (buffer) fgetc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). while(((unsigned long)ftell(inptr) < max_offset) && ((ch = fgetc(inptr)) != '\n') && ch != EOF) data/exifprobe-2.0.1+git20170416.3c2b769/process.c:4429:12: [1] (buffer) fgetc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). return(fgetc(inptr)); data/exifprobe-2.0.1+git20170416.3c2b769/process.c:4440:64: [1] (buffer) fgetc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). while(((unsigned long)ftell(inptr) < max_offset) && ((ch = fgetc(inptr)) != '[') && ch != EOF) data/exifprobe-2.0.1+git20170416.3c2b769/process.c:4480:14: [1] (buffer) fgetc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). ch = fgetc(inptr); data/exifprobe-2.0.1+git20170416.3c2b769/process.c:4490:18: [1] (buffer) fgetc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). ch = fgetc(inptr); data/exifprobe-2.0.1+git20170416.3c2b769/readfile.c:750:30: [1] (buffer) fgetc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). (*bufp = fgetc(inptr)) && data/exifprobe-2.0.1+git20170416.3c2b769/readfile.c:793:13: [1] (buffer) fgetc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). else if(fgetc(inptr) == -1) ANALYSIS SUMMARY: Hits = 94 Lines analyzed = 41159 in approximately 1.19 seconds (34578 lines/second) Physical Source Lines of Code (SLOC) = 34799 Hits@level = [0] 4080 [1] 41 [2] 43 [3] 5 [4] 5 [5] 0 Hits@level+ = [0+] 4174 [1+] 94 [2+] 53 [3+] 10 [4+] 5 [5+] 0 Hits/KSLOC@level+ = [0+] 119.946 [1+] 2.70123 [2+] 1.52303 [3+] 0.287365 [4+] 0.143682 [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.