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/txt2pdbdoc-1.4.4/palm.h Examining data/txt2pdbdoc-1.4.4/txt2pdbdoc.c FINAL RESULTS: data/txt2pdbdoc-1.4.4/txt2pdbdoc.c:205:5: [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( PACKAGE " " VERSION "\n" ); data/txt2pdbdoc-1.4.4/txt2pdbdoc.c:181:17: [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, opts )) != EOF ) data/txt2pdbdoc-1.4.4/palm.h:132: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 name[ dmDBNameLength ]; data/txt2pdbdoc-1.4.4/palm.h:141: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 type[4]; data/txt2pdbdoc-1.4.4/palm.h:142: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 creator[4]; data/txt2pdbdoc-1.4.4/txt2pdbdoc.c:499: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( &header.creationDate, &date, 4 ); data/txt2pdbdoc-1.4.4/txt2pdbdoc.c:501: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( &header.modificationDate, &date, 4 ); data/txt2pdbdoc-1.4.4/txt2pdbdoc.c:743: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). FILE *f = fopen( file_name, "rb" ); data/txt2pdbdoc-1.4.4/txt2pdbdoc.c:750: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). FILE *f = fopen( file_name, "wb" ); data/txt2pdbdoc-1.4.4/txt2pdbdoc.c:493:2: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy( header.name, document_name, sizeof header.name - 1 ); data/txt2pdbdoc-1.4.4/txt2pdbdoc.c:494: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( document_name ) > sizeof header.name - 1 ) data/txt2pdbdoc-1.4.4/txt2pdbdoc.c:495:3: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). Risk is low because the source is a constant string. strncpy( header.name + sizeof header.name - 4, "...", 3 ); data/txt2pdbdoc-1.4.4/txt2pdbdoc.c:506:2: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy( header.type, DOC_TYPE, sizeof header.type ); data/txt2pdbdoc-1.4.4/txt2pdbdoc.c:507:2: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy( header.creator, DOC_CREATOR, sizeof header.creator ); ANALYSIS SUMMARY: Hits = 14 Lines analyzed = 930 in approximately 0.03 seconds (27108 lines/second) Physical Source Lines of Code (SLOC) = 534 Hits@level = [0] 19 [1] 5 [2] 7 [3] 1 [4] 1 [5] 0 Hits@level+ = [0+] 33 [1+] 14 [2+] 9 [3+] 2 [4+] 1 [5+] 0 Hits/KSLOC@level+ = [0+] 61.7978 [1+] 26.2172 [2+] 16.8539 [3+] 3.74532 [4+] 1.87266 [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.