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/rawtran-1.1/dark.c Examining data/rawtran-1.1/fitspath.c Examining data/rawtran-1.1/main.c Examining data/rawtran-1.1/pixmap.c Examining data/rawtran-1.1/pixmap.h Examining data/rawtran-1.1/rawtran.c Examining data/rawtran-1.1/rawtran.h FINAL RESULTS: data/rawtran-1.1/dark.c:53:3: [4] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). strcpy(com,dcraw_command); data/rawtran-1.1/dark.c:54:3: [4] (buffer) strcat: Does not check for buffer overflows when concatenating to destination [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or snprintf (warning: strncat is easily misused). strcat(com,filename); data/rawtran-1.1/dark.c:55:12: [4] (shell) system: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. status = system(com); data/rawtran-1.1/dark.c:72:7: [4] (race) access: This usually indicates a security flaw. If an attacker can change anything along the path between the call to access() and the file's actual use (e.g., by moving files), the attacker can exploit the race condition (CWE-362/CWE-367!). Set up the correct permissions (e.g., using setuid()) and try to open the file directly. if( access(pgmname,R_OK) != 0 ) { data/rawtran-1.1/fitspath.c:45:3: [4] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). strcpy(fits, clobber ? "!" : ""); data/rawtran-1.1/fitspath.c:57:5: [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(fits,basename); data/rawtran-1.1/fitspath.c:60:3: [4] (buffer) strcat: Does not check for buffer overflows when concatenating to destination [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or snprintf (warning: strncat is easily misused). strcat(fits,suff); data/rawtran-1.1/fitspath.c:75:3: [4] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). strcpy(name,base); data/rawtran-1.1/main.c:244:7: [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(frm[i].fits, clobber ? "!" : ""); data/rawtran-1.1/main.c:245:7: [4] (buffer) strcat: Does not check for buffer overflows when concatenating to destination [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or snprintf (warning: strncat is easily misused). strcat(frm[i].fits,fits); data/rawtran-1.1/main.c:344:7: [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(fitsname, clobber ? "!" : ""); data/rawtran-1.1/main.c:345:7: [4] (buffer) strcat: Does not check for buffer overflows when concatenating to destination [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or snprintf (warning: strncat is easily misused). strcat(fitsname,fits); data/rawtran-1.1/main.c:413:12: [4] (shell) system: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. status = system("dcraw >&-"); data/rawtran-1.1/rawtran.c:118:3: [4] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). strcpy(add,execs); data/rawtran-1.1/rawtran.c:121:5: [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(add,dark); data/rawtran-1.1/rawtran.c:126:5: [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(add,adds); data/rawtran-1.1/rawtran.c:131:3: [4] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). strcpy(com,dcraw_info_command); data/rawtran-1.1/rawtran.c:132:3: [4] (buffer) strcat: Does not check for buffer overflows when concatenating to destination [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or snprintf (warning: strncat is easily misused). strcat(com,raw); data/rawtran-1.1/rawtran.c:133:16: [4] (shell) popen: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. if( (dcraw = popen(com,"r")) == NULL ) { data/rawtran-1.1/rawtran.c:199:3: [4] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). strcpy(com,dcraw_command); data/rawtran-1.1/rawtran.c:200:3: [4] (buffer) strcat: Does not check for buffer overflows when concatenating to destination [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or snprintf (warning: strncat is easily misused). strcat(com,opts); data/rawtran-1.1/rawtran.c:202:3: [4] (buffer) strcat: Does not check for buffer overflows when concatenating to destination [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or snprintf (warning: strncat is easily misused). strcat(com,add); data/rawtran-1.1/rawtran.c:204:3: [4] (buffer) strcat: Does not check for buffer overflows when concatenating to destination [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or snprintf (warning: strncat is easily misused). strcat(com,raw); data/rawtran-1.1/rawtran.c:206:16: [4] (shell) popen: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. if( (dcraw = popen(com,"r")) == NULL ) { data/rawtran-1.1/rawtran.c:455:5: [4] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). strcpy(add,dark_comment); data/rawtran-1.1/rawtran.c:456:5: [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(add,dark); data/rawtran-1.1/rawtran.c:462:5: [4] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). strcpy(add,rum_comment); data/rawtran-1.1/rawtran.c:463:5: [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(add,com); data/rawtran-1.1/pixmap.c:39: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 l[len+1]; /* len+1 */ data/rawtran-1.1/pixmap.c:71: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 magic[mlen+1]; /* mlen + 1 */ data/rawtran-1.1/pixmap.c:190: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,"w")) == NULL ) data/rawtran-1.1/pixmap.c:238: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( (ppmfile = fopen(ppmname,"r")) == NULL ) { data/rawtran-1.1/rawtran.c:75: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 exif[MAXEXIF][FLEN_CARD+1]; data/rawtran-1.1/rawtran.c:76: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 stime[FLEN_CARD+1] = ""; data/rawtran-1.1/rawtran.c:77: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 etime[FLEN_CARD+1] = ""; data/rawtran-1.1/rawtran.c:78: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 camera[FLEN_CARD+1] = ""; data/rawtran-1.1/rawtran.c:79: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 aperture[FLEN_CARD+1] = ""; data/rawtran-1.1/rawtran.c:120:5: [2] (buffer) strcat: Does not check for buffer overflows when concatenating to destination [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or snprintf (warning: strncat is easily misused). Risk is low because the source is a constant string. strcat(add," -K "); data/rawtran-1.1/rawtran.c:245: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(flux,p->data,nbytes); data/rawtran-1.1/rawtran.c:275:2: [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(flux,p->data + idx*npixels,nbytes); data/rawtran-1.1/rawtran.c:363: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(flux,p->data,npixels); data/rawtran-1.1/dark.c:52: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). com = malloc(strlen(dcraw_command)+strlen(filename)+1); data/rawtran-1.1/dark.c:52: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). com = malloc(strlen(dcraw_command)+strlen(filename)+1); data/rawtran-1.1/fitspath.c:41: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). fits = malloc(strlen(raw) + strlen(suff) + 2); data/rawtran-1.1/fitspath.c:41: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). fits = malloc(strlen(raw) + strlen(suff) + 2); data/rawtran-1.1/fitspath.c:55:5: [1] (buffer) strncat: Easily used incorrectly (e.g., incorrectly computing the correct maximum size to add) [MS-banned] (CWE-120). Consider strcat_s, strlcat, snprintf, or automatically resizing strings. strncat(fits,basename,dot - basename); data/rawtran-1.1/fitspath.c:70: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). name = malloc(strlen(filename)+1); data/rawtran-1.1/main.c:243:28: [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). frm[i].fits = malloc(strlen(fits) + 2); data/rawtran-1.1/main.c:343:25: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). fitsname = malloc(strlen(fits) + 2); data/rawtran-1.1/pixmap.c:42:15: [1] (buffer) fgetc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). while( (c = fgetc(f)) != EOF && isspace(c) ); data/rawtran-1.1/pixmap.c:53:18: [1] (buffer) fgetc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). cycle = (c = fgetc(f)) != EOF && isdigit(c) && i < len; data/rawtran-1.1/rawtran.c:112:14: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). m = adds ? strlen(adds) : 0; data/rawtran-1.1/rawtran.c:113:14: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). k = dark ? strlen(dark) : 0; data/rawtran-1.1/rawtran.c:114: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). add = malloc(strlen(execs)+k+m+7); data/rawtran-1.1/rawtran.c:122:5: [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(add," "); data/rawtran-1.1/rawtran.c:125:5: [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(add," "); data/rawtran-1.1/rawtran.c:130: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). com = malloc(strlen(dcraw_info_command)+strlen(raw)+1); data/rawtran-1.1/rawtran.c:130:43: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). com = malloc(strlen(dcraw_info_command)+strlen(raw)+1); data/rawtran-1.1/rawtran.c:152:7: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(stime,exif[i]+strlen(key),FLEN_CARD); data/rawtran-1.1/rawtran.c:152: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). strncpy(stime,exif[i]+strlen(key),FLEN_CARD); data/rawtran-1.1/rawtran.c:156:2: [1] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). Risk is low because the source is a constant character. strcpy(stime,""); data/rawtran-1.1/rawtran.c:162:7: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(etime,exif[i]+strlen(key),FLEN_CARD); data/rawtran-1.1/rawtran.c:162: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). strncpy(etime,exif[i]+strlen(key),FLEN_CARD); data/rawtran-1.1/rawtran.c:174:7: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(camera,exif[i]+strlen(key),FLEN_CARD); data/rawtran-1.1/rawtran.c:174: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). strncpy(camera,exif[i]+strlen(key),FLEN_CARD); data/rawtran-1.1/rawtran.c:179:26: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if( sscanf(exif[i]+strlen(key),"%d",&iso) != 1 ) data/rawtran-1.1/rawtran.c:186:7: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(aperture,exif[i]+strlen(key),FLEN_CARD); data/rawtran-1.1/rawtran.c:186:32: [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). strncpy(aperture,exif[i]+strlen(key),FLEN_CARD); data/rawtran-1.1/rawtran.c:191:26: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if( sscanf(exif[i]+strlen(key),"%f",&focus) != 1 ) data/rawtran-1.1/rawtran.c:198: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). com = malloc(strlen(dcraw_command)+strlen(opts)+strlen(add)+strlen(raw)+3); data/rawtran-1.1/rawtran.c:198: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). com = malloc(strlen(dcraw_command)+strlen(opts)+strlen(add)+strlen(raw)+3); data/rawtran-1.1/rawtran.c:198:51: [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). com = malloc(strlen(dcraw_command)+strlen(opts)+strlen(add)+strlen(raw)+3); data/rawtran-1.1/rawtran.c:198:63: [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). com = malloc(strlen(dcraw_command)+strlen(opts)+strlen(add)+strlen(raw)+3); data/rawtran-1.1/rawtran.c:201:3: [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(com," "); data/rawtran-1.1/rawtran.c:203:3: [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(com," "); data/rawtran-1.1/rawtran.c:454: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). add = malloc(strlen(dark_comment)+strlen(dark)+1); data/rawtran-1.1/rawtran.c:454:39: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). add = malloc(strlen(dark_comment)+strlen(dark)+1); data/rawtran-1.1/rawtran.c:461: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). add = malloc(strlen(rum_comment)+strlen(com)+1); data/rawtran-1.1/rawtran.c:461: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). add = malloc(strlen(rum_comment)+strlen(com)+1); ANALYSIS SUMMARY: Hits = 79 Lines analyzed = 1495 in approximately 0.07 seconds (20695 lines/second) Physical Source Lines of Code (SLOC) = 1035 Hits@level = [0] 31 [1] 38 [2] 13 [3] 0 [4] 28 [5] 0 Hits@level+ = [0+] 110 [1+] 79 [2+] 41 [3+] 28 [4+] 28 [5+] 0 Hits/KSLOC@level+ = [0+] 106.28 [1+] 76.3285 [2+] 39.6135 [3+] 27.0531 [4+] 27.0531 [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.