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/gvm-libs-11.0.1/base/array.c Examining data/gvm-libs-11.0.1/base/array.h Examining data/gvm-libs-11.0.1/base/array_tests.c Examining data/gvm-libs-11.0.1/base/credentials.c Examining data/gvm-libs-11.0.1/base/credentials.h Examining data/gvm-libs-11.0.1/base/cvss.c Examining data/gvm-libs-11.0.1/base/cvss.h Examining data/gvm-libs-11.0.1/base/drop_privileges.c Examining data/gvm-libs-11.0.1/base/drop_privileges.h Examining data/gvm-libs-11.0.1/base/hosts.c Examining data/gvm-libs-11.0.1/base/hosts.h Examining data/gvm-libs-11.0.1/base/logging.c Examining data/gvm-libs-11.0.1/base/logging.h Examining data/gvm-libs-11.0.1/base/networking.c Examining data/gvm-libs-11.0.1/base/networking.h Examining data/gvm-libs-11.0.1/base/nvti.c Examining data/gvm-libs-11.0.1/base/nvti.h Examining data/gvm-libs-11.0.1/base/pidfile.c Examining data/gvm-libs-11.0.1/base/pidfile.h Examining data/gvm-libs-11.0.1/base/prefs.c Examining data/gvm-libs-11.0.1/base/prefs.h Examining data/gvm-libs-11.0.1/base/proctitle.c Examining data/gvm-libs-11.0.1/base/proctitle.h Examining data/gvm-libs-11.0.1/base/pwpolicy.c Examining data/gvm-libs-11.0.1/base/pwpolicy.h Examining data/gvm-libs-11.0.1/base/settings.c Examining data/gvm-libs-11.0.1/base/settings.h Examining data/gvm-libs-11.0.1/base/strings.c Examining data/gvm-libs-11.0.1/base/strings.h Examining data/gvm-libs-11.0.1/base/version.c Examining data/gvm-libs-11.0.1/base/version.h Examining data/gvm-libs-11.0.1/base/version_tests.c Examining data/gvm-libs-11.0.1/gmp/gmp.c Examining data/gvm-libs-11.0.1/gmp/gmp.h Examining data/gvm-libs-11.0.1/osp/osp.c Examining data/gvm-libs-11.0.1/osp/osp.h Examining data/gvm-libs-11.0.1/tests/test-hosts.c Examining data/gvm-libs-11.0.1/util/authutils.c Examining data/gvm-libs-11.0.1/util/authutils.h Examining data/gvm-libs-11.0.1/util/compressutils.c Examining data/gvm-libs-11.0.1/util/compressutils.h Examining data/gvm-libs-11.0.1/util/fileutils.c Examining data/gvm-libs-11.0.1/util/fileutils.h Examining data/gvm-libs-11.0.1/util/gpgmeutils.c Examining data/gvm-libs-11.0.1/util/gpgmeutils.h Examining data/gvm-libs-11.0.1/util/kb.c Examining data/gvm-libs-11.0.1/util/kb.h Examining data/gvm-libs-11.0.1/util/ldaputils.c Examining data/gvm-libs-11.0.1/util/ldaputils.h Examining data/gvm-libs-11.0.1/util/nvticache.c Examining data/gvm-libs-11.0.1/util/nvticache.h Examining data/gvm-libs-11.0.1/util/radiusutils.c Examining data/gvm-libs-11.0.1/util/radiusutils.h Examining data/gvm-libs-11.0.1/util/serverutils.c Examining data/gvm-libs-11.0.1/util/serverutils.h Examining data/gvm-libs-11.0.1/util/sshutils.c Examining data/gvm-libs-11.0.1/util/sshutils.h Examining data/gvm-libs-11.0.1/util/uuidutils.c Examining data/gvm-libs-11.0.1/util/uuidutils.h Examining data/gvm-libs-11.0.1/util/xmlutils.c Examining data/gvm-libs-11.0.1/util/xmlutils.h Examining data/gvm-libs-11.0.1/util/xmlutils_tests.c FINAL RESULTS: data/gvm-libs-11.0.1/util/gpgmeutils.c:118:11: [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 (dir, F_OK)) data/gvm-libs-11.0.1/util/serverutils.h:87:27: [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. __attribute__ ((format (printf, 2, 3))); data/gvm-libs-11.0.1/base/hosts.c:1294:15: [3] (random) g_rand_int_range: This function is not sufficiently random for security-related functions such as key and nonce creation (CWE-327). Use a more secure technique for acquiring random values. int j = g_rand_int_range (rand, 0, hosts->count); data/gvm-libs-11.0.1/base/hosts.c:382:9: [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). end = atoi (last_str); data/gvm-libs-11.0.1/base/hosts.c:543: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 (&last->s6_addr, &first->s6_addr, 16); data/gvm-libs-11.0.1/base/hosts.c:753: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 (last, first, sizeof (*last)); data/gvm-libs-11.0.1/base/hosts.c:755: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 (&last->s6_addr[15], &end, 1); data/gvm-libs-11.0.1/base/hosts.c:756: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 (&last->s6_addr[14], ((char *) &end) + 1, 1); data/gvm-libs-11.0.1/base/hosts.c:1145:22: [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 current[16]; data/gvm-libs-11.0.1/base/hosts.c:1164:13: [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 (current, &first.s6_addr, 16); data/gvm-libs-11.0.1/base/hosts.c:1178: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 (host->addr6.s6_addr, current, 16); data/gvm-libs-11.0.1/base/hosts.c:1370:15: [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 (&new->addr6, &ip6->s6_addr32[3], sizeof (new->addr)); data/gvm-libs-11.0.1/base/hosts.c:1574: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 (&sa6.sin6_addr, &host->addr6, 16); data/gvm-libs-11.0.1/base/hosts.c:1613:7: [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[INET6_ADDRSTRLEN]; data/gvm-libs-11.0.1/base/hosts.c:1963: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 (ip6, &host->addr6, sizeof (struct in6_addr)); data/gvm-libs-11.0.1/base/logging.c:103:16: [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). return atoi (level); data/gvm-libs-11.0.1/base/networking.c:48: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 global_source_iface[IFNAMSIZ] = {'\0'}; data/gvm-libs-11.0.1/base/networking.c:99:15: [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 (&global_source_addr6.s6_addr, &addr->sin6_addr, data/gvm-libs-11.0.1/base/networking.c:176:5: [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 (addr, &global_source_addr.s_addr, 4); data/gvm-libs-11.0.1/base/networking.c:188:5: [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 (addr6, &global_source_addr6.s6_addr, 16); data/gvm-libs-11.0.1/base/networking.c:250: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 (&ip6->s6_addr32[3], ip4, sizeof (struct in_addr)); data/gvm-libs-11.0.1/base/networking.c:367:11: [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 (&dst, &(addrin->sin6_addr), sizeof (struct in6_addr)); data/gvm-libs-11.0.1/base/networking.c:416:15: [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 (dst, &(addrin->sin_addr), sizeof (struct in_addr)); data/gvm-libs-11.0.1/base/networking.c:421:15: [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 (dst, &(addrin->sin6_addr), sizeof (struct in6_addr)); data/gvm-libs-11.0.1/base/networking.c:665:26: [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). range->start = atoi (element); data/gvm-libs-11.0.1/base/networking.c:666:24: [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). range->end = atoi (hyphen); data/gvm-libs-11.0.1/base/networking.c:678:26: [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). range->start = atoi (element); data/gvm-libs-11.0.1/base/pidfile.c:91:17: [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). int pid = atoi (pidfile_contents); data/gvm-libs-11.0.1/base/prefs.c:150: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[2048]; data/gvm-libs-11.0.1/base/prefs.c:200:24: [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). int timeout = (val ? atoi (val) : 0); data/gvm-libs-11.0.1/base/pwpolicy.c:174: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 line[256]; data/gvm-libs-11.0.1/base/pwpolicy.c:176:8: [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). fp = fopen (fname, "r"); data/gvm-libs-11.0.1/base/pwpolicy.c:361: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 line[256]; data/gvm-libs-11.0.1/base/pwpolicy.c:370:8: [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). fp = fopen (patternfile, "r"); data/gvm-libs-11.0.1/gmp/gmp.c:892:9: [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). ret = atoi (status); data/gvm-libs-11.0.1/osp/osp.c:639:14: [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). progress = atoi (entity_attribute (child, "progress")); data/gvm-libs-11.0.1/osp/osp.c:702:8: [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). rc = atoi (entity_attribute (entity, "status")); data/gvm-libs-11.0.1/osp/osp.c:794:12: [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). status = atoi (entity_attribute (entity, "status")); data/gvm-libs-11.0.1/osp/osp.c:963:8: [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/gvm-libs-11.0.1/osp/osp.c:1040:12: [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). status = atoi (entity_attribute (entity, "status")); data/gvm-libs-11.0.1/osp/osp.c:1172:15: [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). atoi (entity_text (entity_child (child, "mandatory"))); data/gvm-libs-11.0.1/tests/test-hosts.c:80:11: [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[INET_ADDRSTRLEN], name6[INET6_ADDRSTRLEN]; data/gvm-libs-11.0.1/util/authutils.c:207: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. unsigned char *nonce_buffer[256]; data/gvm-libs-11.0.1/util/kb.c:65: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 path[0]; /**< Path to the server socket. */ data/gvm-libs-11.0.1/util/kb.c:139:32: [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). kbr->max_db = (unsigned) atoi (rep->element[1]->str); data/gvm-libs-11.0.1/util/kb.c:580:21: [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). item->v_int = atoi (elt->str); data/gvm-libs-11.0.1/util/kb.c:911:32: [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). nvti_set_category (nvti, atoi (rep->element[NVT_CATEGORY_POS]->str)); data/gvm-libs-11.0.1/util/kb.c:912:31: [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). nvti_set_timeout (nvti, atoi (rep->element[NVT_TIMEOUT_POS]->str)); data/gvm-libs-11.0.1/util/kb.h:97: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 name[0]; /**< Name of this knowledge base item. */ data/gvm-libs-11.0.1/util/ldaputils.c:341:11: [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 *attrs[2] = {"dn", NULL}; data/gvm-libs-11.0.1/util/nvticache.c:125:10: [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). && atoi (time_s) > src_stat.st_mtime) data/gvm-libs-11.0.1/util/nvticache.c:150: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 filename[2048], *fcontent = NULL, *plugin_set; data/gvm-libs-11.0.1/util/nvticache.c:398:14: [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). category = atoi (category_s); data/gvm-libs-11.0.1/util/nvticache.c:418:13: [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). timeout = atoi (timeout_s); data/gvm-libs-11.0.1/util/nvticache.c:531: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 pattern[4096]; data/gvm-libs-11.0.1/util/nvticache.c:546:25: [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). np = nvtpref_new (atoi (array[0]), array[1], array[2], array[3]); data/gvm-libs-11.0.1/util/nvticache.c:590: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 pattern[4096]; data/gvm-libs-11.0.1/util/radiusutils.c:65: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 authserver[4096]; data/gvm-libs-11.0.1/util/radiusutils.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 config_filename[35] = "/tmp/gvm_radius_conf_XXXXXX"; data/gvm-libs-11.0.1/util/radiusutils.c:79:19: [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). int config_fd = mkstemp (config_filename); data/gvm-libs-11.0.1/util/radiusutils.c:210: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 msg[PW_MAX_MSG_SIZE]; data/gvm-libs-11.0.1/util/serverutils.c:186:13: [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 (!(f = fopen (file, "r")) || fseek (f, 0, SEEK_END) != 0 data/gvm-libs-11.0.1/util/sshutils.c:46: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[16 * 2048]; data/gvm-libs-11.0.1/util/xmlutils.c:1643:10: [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 = fopen (file_path, "r"); data/gvm-libs-11.0.1/base/logging.c:100: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). if (level && strlen (level) > 0) data/gvm-libs-11.0.1/base/logging.c:131: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). if (facility && strlen (facility) > 0) data/gvm-libs-11.0.1/base/logging.c:614: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). messagelen = message ? strlen (message) : 0; data/gvm-libs-11.0.1/base/networking.c:108:5: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy (global_source_iface, iface, sizeof (global_source_iface) - 1); data/gvm-libs-11.0.1/base/networking.c:494: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 (element) >= 2) data/gvm-libs-11.0.1/base/networking.c:633:11: [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 (element) >= 2) data/gvm-libs-11.0.1/base/prefs.c:155:3: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy (buffer, config, sizeof (buffer)); data/gvm-libs-11.0.1/base/proctitle.c:82: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). argv_len = envp[i - 1] + strlen (envp[i - 1]) - old_argv[0]; data/gvm-libs-11.0.1/base/proctitle.c:84:37: [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). argv_len = old_argv[argc - 1] + strlen (old_argv[argc - 1]) - old_argv[0]; data/gvm-libs-11.0.1/base/proctitle.c:112: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). i = strlen (formatted); data/gvm-libs-11.0.1/base/proctitle.c:119:3: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy (old_argv[0], formatted, argv_len); data/gvm-libs-11.0.1/base/pwpolicy.c:140:11: [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). int n = strlen (keyword); data/gvm-libs-11.0.1/base/pwpolicy.c:184: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). len = strlen (line); data/gvm-libs-11.0.1/base/pwpolicy.c:189:23: [1] (buffer) getc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). while ((c = getc (fp)) != EOF && c != '\n') data/gvm-libs-11.0.1/base/pwpolicy.c:319:11: [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 (line); data/gvm-libs-11.0.1/base/pwpolicy.c:383: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). len = strlen (line); data/gvm-libs-11.0.1/base/settings.c:63: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). strlen (contents_with_group), data/gvm-libs-11.0.1/gmp/gmp.c:102: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 (status) == 0) data/gvm-libs-11.0.1/gmp/gmp.c:163: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 (status) == 0) data/gvm-libs-11.0.1/gmp/gmp.c:224: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 (status) == 0) data/gvm-libs-11.0.1/gmp/gmp.c:345: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 (status) == 0) data/gvm-libs-11.0.1/gmp/gmp.c:432: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 (status) == 0) data/gvm-libs-11.0.1/gmp/gmp.c:767: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 (status) == 0) data/gvm-libs-11.0.1/gmp/gmp.c:821: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 (status) == 0) data/gvm-libs-11.0.1/gmp/gmp.c:868: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 (status) == 0) data/gvm-libs-11.0.1/gmp/gmp.c:884:11: [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 (id) == 0) data/gvm-libs-11.0.1/gmp/gmp.c:1016: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 (status) == 0) data/gvm-libs-11.0.1/gmp/gmp.c:1197: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 (status_code) == 0) data/gvm-libs-11.0.1/gmp/gmp.c:1420: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 (status_code) == 0) data/gvm-libs-11.0.1/osp/osp.c:142:7: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy (addr.sun_path, host, sizeof (addr.sun_path) - 1); data/gvm-libs-11.0.1/osp/osp.c:143: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). len = strlen (addr.sun_path) + sizeof (addr.sun_family); data/gvm-libs-11.0.1/util/authutils.c:219:54: [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). gcry_md_hash_buffer (GCRY_MD_MD5, hash, seed_pass, strlen (seed_pass)); data/gvm-libs-11.0.1/util/authutils.c:269:54: [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). gcry_md_hash_buffer (GCRY_MD_MD5, hash, seed_pass, strlen (seed_pass)); data/gvm-libs-11.0.1/util/fileutils.c:258: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). if (creation_iso_time && (strlen (creation_iso_time) >= 19)) data/gvm-libs-11.0.1/util/fileutils.c:265:15: [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). || (strlen (ret) == 0))) data/gvm-libs-11.0.1/util/fileutils.c:275: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). if (modification_iso_time && (strlen (modification_iso_time) >= 19)) data/gvm-libs-11.0.1/util/fileutils.c:282:15: [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). || (strlen (ret) == 0))) data/gvm-libs-11.0.1/util/gpgmeutils.c:192:61: [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). &key_data, key_str, (key_len >= 0 ? key_len : (ssize_t) strlen (key_str)), data/gvm-libs-11.0.1/util/kb.c:394:47: [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). kbr = g_malloc0 (sizeof (struct kb_redis) + strlen (kb_path) + 1); data/gvm-libs-11.0.1/util/kb.c:396:3: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy (kbr->path, kb_path, strlen (kb_path)); data/gvm-libs-11.0.1/util/kb.c:396: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 (kbr->path, kb_path, strlen (kb_path)); data/gvm-libs-11.0.1/util/kb.c:427:47: [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). kbr = g_malloc0 (sizeof (struct kb_redis) + strlen (kb_path) + 1); data/gvm-libs-11.0.1/util/kb.c:429:3: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy (kbr->path, kb_path, strlen (kb_path)); data/gvm-libs-11.0.1/util/kb.c:429: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 (kbr->path, kb_path, strlen (kb_path)); data/gvm-libs-11.0.1/util/kb.c:469:47: [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). kbr = g_malloc0 (sizeof (struct kb_redis) + strlen (kb_path) + 1); data/gvm-libs-11.0.1/util/kb.c:471:3: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy (kbr->path, kb_path, strlen (kb_path)); data/gvm-libs-11.0.1/util/kb.c:471: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 (kbr->path, kb_path, strlen (kb_path)); data/gvm-libs-11.0.1/util/kb.c:569: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). namelen = strlen (name) + 1; data/gvm-libs-11.0.1/util/kb.c:591:3: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy (item->name, name, namelen); data/gvm-libs-11.0.1/util/ldaputils.c:194: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 (password) == 0) data/gvm-libs-11.0.1/util/ldaputils.c:217:46: [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). g_file_set_contents (name, cacert, strlen (cacert), &error); data/gvm-libs-11.0.1/util/ldaputils.c:359: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). if ((found_dn == NULL) || (strlen (found_dn) == 0U)) data/gvm-libs-11.0.1/util/ldaputils.c:374: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). credential.bv_len = strlen (password); data/gvm-libs-11.0.1/util/ldaputils.c:432:8: [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). ln = strlen (authdn); data/gvm-libs-11.0.1/util/serverutils.c:297:15: [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). data.size = strlen (get_cert_pub_mem ()); data/gvm-libs-11.0.1/util/serverutils.c:308:15: [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). data.size = strlen (get_cert_priv_mem ()); data/gvm-libs-11.0.1/util/serverutils.c:560:13: [1] (obsolete) usleep: This C routine is considered obsolete (as opposed to the shell command by the same name). The interaction of this function with SIGALRM and other timer functions such as sleep(), alarm(), setitimer(), and nanosleep() is unspecified (CWE-676). Use nanosleep(2) or setitimer(2) instead. usleep (MIN ((retries - 10) * 10000, 5000000)); data/gvm-libs-11.0.1/util/serverutils.c:1201: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). pub.size = strlen (pub_key); data/gvm-libs-11.0.1/util/serverutils.c:1203: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). priv.size = strlen (priv_key); data/gvm-libs-11.0.1/util/serverutils.c:1220: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). data.size = strlen (ca_cert); data/gvm-libs-11.0.1/util/sshutils.c:53:15: [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). data.size = strlen (pkcs8_key); data/gvm-libs-11.0.1/util/xmlutils.c:821:19: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). count = read (socket, buffer, BUFFER_SIZE); data/gvm-libs-11.0.1/util/xmlutils.c:1217:54: [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). g_markup_parse_context_parse (xml_context, string, strlen (string), &error); data/gvm-libs-11.0.1/util/xmlutils.c:1694: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). doc = xmlReadMemory (string, strlen (string), "noname.xml", NULL, 0); ANALYSIS SUMMARY: Hits = 128 Lines analyzed = 22717 in approximately 0.58 seconds (38888 lines/second) Physical Source Lines of Code (SLOC) = 13143 Hits@level = [0] 45 [1] 64 [2] 61 [3] 1 [4] 2 [5] 0 Hits@level+ = [0+] 173 [1+] 128 [2+] 64 [3+] 3 [4+] 2 [5+] 0 Hits/KSLOC@level+ = [0+] 13.1629 [1+] 9.73902 [2+] 4.86951 [3+] 0.228258 [4+] 0.152172 [5+] 0 Dot directories skipped = 3 (--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.