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/sks-1.1.6+git20200620.9e9d504/bdb/bdb_stubs.c Examining data/sks-1.1.6+git20200620.9e9d504/bdb/bdb_stubs.h Examining data/sks-1.1.6+git20200620.9e9d504/bdb/dbstubs.c Examining data/sks-1.1.6+git20200620.9e9d504/bdb/dbstubs.h Examining data/sks-1.1.6+git20200620.9e9d504/bdb/templ.c Examining data/sks-1.1.6+git20200620.9e9d504/crc.c Examining data/sks-1.1.6+git20200620.9e9d504/tz.c FINAL RESULTS: data/sks-1.1.6+git20200620.9e9d504/bdb/bdb_stubs.c:368: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(db_message, msg); data/sks-1.1.6+git20200620.9e9d504/bdb/bdb_stubs.c:383:21: [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(output_message, db_message); data/sks-1.1.6+git20200620.9e9d504/bdb/bdb_stubs.c:384:21: [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(output_message, nl); data/sks-1.1.6+git20200620.9e9d504/bdb/bdb_stubs.c:389:21: [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(output_message, db_message); data/sks-1.1.6+git20200620.9e9d504/bdb/bdb_stubs.c:390:21: [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(output_message, nl); data/sks-1.1.6+git20200620.9e9d504/bdb/dbstubs.c:59:19: [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. if (err != 0) { printf(raise_db("db_env_create error: ")); } data/sks-1.1.6+git20200620.9e9d504/bdb/bdb_stubs.c:76: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((char *)String_val(result),p,len); data/sks-1.1.6+git20200620.9e9d504/bdb/bdb_stubs.c:269: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 version[10]; data/sks-1.1.6+git20200620.9e9d504/bdb/bdb_stubs.c:272:3: [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(version, "%d.%d.%d", major, minor, patch); data/sks-1.1.6+git20200620.9e9d504/bdb/bdb_stubs.c:347:26: [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). err = UW_dbenv(dbenv)->open(UW_dbenv(dbenv), directory, data/sks-1.1.6+git20200620.9e9d504/bdb/bdb_stubs.c:363: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 db_message[255]; data/sks-1.1.6+git20200620.9e9d504/bdb/bdb_stubs.c:375:9: [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 output_message[255]; data/sks-1.1.6+git20200620.9e9d504/bdb/bdb_stubs.c:395:17: [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(output_message, "Unable to open environment"); data/sks-1.1.6+git20200620.9e9d504/bdb/bdb_stubs.c:566:20: [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). err = UW_db(db)->open(UW_db(db), data/sks-1.1.6+git20200620.9e9d504/bdb/dbstubs.c:61:16: [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). err = dbenv->open(dbenv, data/sks-1.1.6+git20200620.9e9d504/bdb/bdb_stubs.c:367:12: [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(msg) < 254) data/sks-1.1.6+git20200620.9e9d504/bdb/bdb_stubs.c:382: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). if(strlen(db_message) < 253){ data/sks-1.1.6+git20200620.9e9d504/bdb/bdb_stubs.c:388: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). if(strlen(output_message) + strlen(db_message) < 253){ data/sks-1.1.6+git20200620.9e9d504/bdb/bdb_stubs.c:388:45: [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(output_message) + strlen(db_message) < 253){ ANALYSIS SUMMARY: Hits = 19 Lines analyzed = 1833 in approximately 0.10 seconds (18757 lines/second) Physical Source Lines of Code (SLOC) = 1064 Hits@level = [0] 0 [1] 4 [2] 9 [3] 0 [4] 6 [5] 0 Hits@level+ = [0+] 19 [1+] 19 [2+] 15 [3+] 6 [4+] 6 [5+] 0 Hits/KSLOC@level+ = [0+] 17.8571 [1+] 17.8571 [2+] 14.0977 [3+] 5.6391 [4+] 5.6391 [5+] 0 Dot directories skipped = 2 (--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.