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/poster-20050907/getopt.c Examining data/poster-20050907/poster.c FINAL RESULTS: data/poster-20050907/poster.c:435: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( filename, getenv( "TEMP" ) ); data/poster-20050907/getopt.c:59: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(nargc, nargv, ostr) data/poster-20050907/poster.c:189:16: [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, "vfi:c:w:m:p:s:o:P:F")) != EOF) data/poster-20050907/poster.c:432:7: [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 ( getenv( "TEMP" ) == NULL ) data/poster-20050907/poster.c:435:21: [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. strcat( filename, getenv( "TEMP" ) ); data/poster-20050907/getopt.c:30:6: [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 ebuf[2]; \ data/poster-20050907/poster.c:84:26: [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 void box_convert( char *boxspec, double psbox[4]); data/poster-20050907/poster.c:86: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. static void margin_convert( char *spec, double margin[2]); data/poster-20050907/poster.c:429:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char filename[ 256 ] = {0}; data/poster-20050907/poster.c:433:3: [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( filename, "/tmp" ); data/poster-20050907/poster.c:436:2: [2] (buffer) strcat: Does not check for buffer overflows when concatenating to destination [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or snprintf (warning: strncat is easily misused). Risk is low because the source is a constant string. strcat( filename, "/poster.XXXXXX" ); data/poster-20050907/poster.c:438:7: [2] (tmpfile) mkstemp: Potential for temporary file vulnerability in some circumstances. Some older Unix-like systems create temp files with permission to write by all by default, so be sure to set the umask to override this. Also, some older Unix systems might fail to use O_EXCL when opening the file, so make sure that O_EXCL is used by the library (CWE-377). fd = mkstemp( filename ); data/poster-20050907/poster.c:446: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[ 4096 ]; data/poster-20050907/poster.c:604: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. static void margin_convert( char *spec, double margin[2]) data/poster-20050907/poster.c:636:26: [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 void box_convert( char *boxspec, double psbox[4]) data/poster-20050907/poster.c:741:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char *c, buf[BUFSIZE]; data/poster-20050907/poster.c:1010:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf[2][BUFSIZE]; data/poster-20050907/getopt.c:31: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). (void)write(2, nargv, (unsigned int)strlen(nargv)); \ data/poster-20050907/getopt.c:32: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). (void)write(2, s, (unsigned int)strlen(s)); \ data/poster-20050907/poster.c:608: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). if (1==sscanf( spec, "%lf%n", &x, &n) && x==0.0 && n==strlen(spec)) data/poster-20050907/poster.c:611:19: [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 (spec[ strlen( spec) - 1] == '%') data/poster-20050907/poster.c:667:6: [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). l = strlen( spec); data/poster-20050907/poster.c:673: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 (l == strlen( mediatable[i][0])) data/poster-20050907/poster.c:755: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). n = strlen( buf ); data/poster-20050907/poster.c:1056: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 (!IS_DSC(buf[bp]) && strlen( buf[bp])) ANALYSIS SUMMARY: Hits = 25 Lines analyzed = 1190 in approximately 0.06 seconds (19465 lines/second) Physical Source Lines of Code (SLOC) = 933 Hits@level = [0] 95 [1] 8 [2] 12 [3] 4 [4] 1 [5] 0 Hits@level+ = [0+] 120 [1+] 25 [2+] 17 [3+] 5 [4+] 1 [5+] 0 Hits/KSLOC@level+ = [0+] 128.617 [1+] 26.7953 [2+] 18.2208 [3+] 5.35906 [4+] 1.07181 [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.