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/pkcs11-helper-1.26/lib/pkcs11h-serialization.c Examining data/pkcs11-helper-1.26/lib/_pkcs11h-crypto-mbedtls.c Examining data/pkcs11-helper-1.26/lib/_pkcs11h-certificate.h Examining data/pkcs11-helper-1.26/lib/_pkcs11h-util.h Examining data/pkcs11-helper-1.26/lib/pkcs11h-session.c Examining data/pkcs11-helper-1.26/lib/pkcs11h-token.c Examining data/pkcs11-helper-1.26/lib/pkcs11h-sys.c Examining data/pkcs11-helper-1.26/lib/pkcs11h-data.c Examining data/pkcs11-helper-1.26/lib/_pkcs11h-token.h Examining data/pkcs11-helper-1.26/lib/_pkcs11h-threading.h Examining data/pkcs11-helper-1.26/lib/_pkcs11h-openssl.h Examining data/pkcs11-helper-1.26/lib/pkcs11h-certificate.c Examining data/pkcs11-helper-1.26/lib/_pkcs11h-sys.h Examining data/pkcs11-helper-1.26/lib/common.h Examining data/pkcs11-helper-1.26/lib/_pkcs11h-crypto-openssl.c Examining data/pkcs11-helper-1.26/lib/_pkcs11h-crypto.h Examining data/pkcs11-helper-1.26/lib/_pkcs11h-slotevent.h Examining data/pkcs11-helper-1.26/lib/pkcs11h-threading.c Examining data/pkcs11-helper-1.26/lib/_pkcs11h-session.h Examining data/pkcs11-helper-1.26/lib/pkcs11h-slotevent.c Examining data/pkcs11-helper-1.26/lib/_pkcs11h-crypto-nss.c Examining data/pkcs11-helper-1.26/lib/_pkcs11h-crypto-gnutls.c Examining data/pkcs11-helper-1.26/lib/pkcs11h-mem.c Examining data/pkcs11-helper-1.26/lib/pkcs11h-crypto.c Examining data/pkcs11-helper-1.26/lib/pkcs11h-core.c Examining data/pkcs11-helper-1.26/lib/_pkcs11h-core.h Examining data/pkcs11-helper-1.26/lib/pkcs11h-openssl.c Examining data/pkcs11-helper-1.26/lib/_pkcs11h-mem.h Examining data/pkcs11-helper-1.26/lib/pkcs11h-util.c Examining data/pkcs11-helper-1.26/lib/_pkcs11h-crypto-cryptoapi.c Examining data/pkcs11-helper-1.26/include/pkcs11-helper-1.0/pkcs11h-token.h Examining data/pkcs11-helper-1.26/include/pkcs11-helper-1.0/pkcs11h-data.h Examining data/pkcs11-helper-1.26/include/pkcs11-helper-1.0/pkcs11h-engines.h Examining data/pkcs11-helper-1.26/include/pkcs11-helper-1.0/pkcs11h-certificate.h Examining data/pkcs11-helper-1.26/include/pkcs11-helper-1.0/pkcs11h-version.h Examining data/pkcs11-helper-1.26/include/pkcs11-helper-1.0/pkcs11h-openssl.h Examining data/pkcs11-helper-1.26/include/pkcs11-helper-1.0/pkcs11h-core.h Examining data/pkcs11-helper-1.26/include/pkcs11-helper-1.0/pkcs11.h Examining data/pkcs11-helper-1.26/include/pkcs11-helper-1.0/pkcs11h-def.h Examining data/pkcs11-helper-1.26/tests/test-basic/test-basic.c Examining data/pkcs11-helper-1.26/tests/test-openssl/test-openssl.c Examining data/pkcs11-helper-1.26/tests/test-slotevent/test-slotevent.c Examining data/pkcs11-helper-1.26/tests/test-certificate/test-certificate.c Examining data/pkcs11-helper-1.26/tests/test-fork/test-fork.c Examining data/pkcs11-helper-1.26/config-w32-vc.h FINAL RESULTS: data/pkcs11-helper-1.26/lib/_pkcs11h-core.h:211:26: [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/pkcs11-helper-1.26/lib/_pkcs11h-crypto-nss.c:177:2: [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 (dn, cert->subjectName); data/pkcs11-helper-1.26/tests/test-basic/test-basic.c:21:2: [4] (format) vfprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. vfprintf (stdout, format, args); data/pkcs11-helper-1.26/tests/test-certificate/test-certificate.c:56:2: [4] (format) vfprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. vfprintf (stdout, format, args); data/pkcs11-helper-1.26/tests/test-certificate/test-certificate.c:126:6: [4] (misc) getpass: This function is obsolete and not portable. It was in SUSv2 but removed by POSIX.2. What it does exactly varies considerably between systems, particularly in where its prompt is displayed and where it gets its data (e.g., /dev/tty, stdin, stderr, etc.). In addition, some implementations overflow buffers. (CWE-676, CWE-120, CWE-20). Make the specific calls to do exactly what you want. If you continue to use it, or write your own, be sure to zero the password as soon as possible to avoid leaving the cleartext password visible in the process' address space. p = getpass (prompt); data/pkcs11-helper-1.26/tests/test-fork/test-fork.c:33:2: [4] (format) vfprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. vfprintf (stdout, format, args); data/pkcs11-helper-1.26/tests/test-openssl/test-openssl.c:57:2: [4] (format) vfprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. vfprintf (stdout, format, args); data/pkcs11-helper-1.26/tests/test-openssl/test-openssl.c:127:6: [4] (misc) getpass: This function is obsolete and not portable. It was in SUSv2 but removed by POSIX.2. What it does exactly varies considerably between systems, particularly in where its prompt is displayed and where it gets its data (e.g., /dev/tty, stdin, stderr, etc.). In addition, some implementations overflow buffers. (CWE-676, CWE-120, CWE-20). Make the specific calls to do exactly what you want. If you continue to use it, or write your own, be sure to zero the password as soon as possible to avoid leaving the cleartext password visible in the process' address space. p = getpass (prompt); data/pkcs11-helper-1.26/tests/test-slotevent/test-slotevent.c:47:2: [4] (format) vfprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. vfprintf (stdout, format, args); data/pkcs11-helper-1.26/lib/pkcs11h-core.c:762:28: [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 ((initargs.pReserved = getenv("PKCS11H_INIT_ARGS_RESERVED")) != NULL) { data/pkcs11-helper-1.26/include/pkcs11-helper-1.0/pkcs11.h:198: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 manufacturer_id[32]; data/pkcs11-helper-1.26/include/pkcs11-helper-1.0/pkcs11.h:200: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 library_description[32]; data/pkcs11-helper-1.26/include/pkcs11-helper-1.0/pkcs11.h:215: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 slot_description[64]; data/pkcs11-helper-1.26/include/pkcs11-helper-1.0/pkcs11.h:216: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 manufacturer_id[32]; data/pkcs11-helper-1.26/include/pkcs11-helper-1.0/pkcs11.h:231: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 label[32]; data/pkcs11-helper-1.26/include/pkcs11-helper-1.0/pkcs11.h:232: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 manufacturer_id[32]; data/pkcs11-helper-1.26/include/pkcs11-helper-1.0/pkcs11.h:233: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 model[16]; data/pkcs11-helper-1.26/include/pkcs11-helper-1.0/pkcs11.h:234: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 serial_number[16]; data/pkcs11-helper-1.26/include/pkcs11-helper-1.0/pkcs11.h:248: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 utc_time[16]; data/pkcs11-helper-1.26/include/pkcs11-helper-1.0/pkcs11.h:469: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 year[4]; data/pkcs11-helper-1.26/include/pkcs11-helper-1.0/pkcs11.h:470: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 month[2]; data/pkcs11-helper-1.26/include/pkcs11-helper-1.0/pkcs11.h:471: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 day[2]; data/pkcs11-helper-1.26/include/pkcs11-helper-1.0/pkcs11h-certificate.h:109: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 displayName[1024]; data/pkcs11-helper-1.26/include/pkcs11-helper-1.0/pkcs11h-core.h:270: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 display[1024]; data/pkcs11-helper-1.26/include/pkcs11-helper-1.0/pkcs11h-core.h:272: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 manufacturerID[sizeof (((CK_TOKEN_INFO *)NULL)->manufacturerID)+1]; data/pkcs11-helper-1.26/include/pkcs11-helper-1.0/pkcs11h-core.h:274: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 model[sizeof (((CK_TOKEN_INFO *)NULL)->model)+1]; data/pkcs11-helper-1.26/include/pkcs11-helper-1.0/pkcs11h-core.h:276: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 serialNumber[sizeof (((CK_TOKEN_INFO *)NULL)->serialNumber)+1]; data/pkcs11-helper-1.26/include/pkcs11-helper-1.0/pkcs11h-core.h:278: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 label[sizeof (((CK_TOKEN_INFO *)NULL)->label)+1]; data/pkcs11-helper-1.26/lib/_pkcs11h-core.h:112: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 reference[1024]; data/pkcs11-helper-1.26/lib/_pkcs11h-core.h:113: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 manufacturerID[sizeof (((CK_TOKEN_INFO *)NULL)->manufacturerID)+1]; data/pkcs11-helper-1.26/lib/pkcs11h-serialization.c:69:8: [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. const char *sources[5]; data/pkcs11-helper-1.26/lib/pkcs11h-session.c:1006:4: [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 pin[1024]; data/pkcs11-helper-1.26/lib/pkcs11h-util.c:83: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[3] = {'\0', '\0', '\0'}; data/pkcs11-helper-1.26/lib/pkcs11h-util.c:241: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 b[3]; data/pkcs11-helper-1.26/tests/test-certificate/test-certificate.c:39: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 temp[10]; data/pkcs11-helper-1.26/tests/test-certificate/test-certificate.c:69: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[1024]; data/pkcs11-helper-1.26/tests/test-certificate/test-certificate.c:110: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 prompt[1024]; data/pkcs11-helper-1.26/tests/test-openssl/test-openssl.c:40: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 temp[10]; data/pkcs11-helper-1.26/tests/test-openssl/test-openssl.c:70: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[1024]; data/pkcs11-helper-1.26/tests/test-openssl/test-openssl.c:111: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 prompt[1024]; data/pkcs11-helper-1.26/tests/test-slotevent/test-slotevent.c:32: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 temp[10]; data/pkcs11-helper-1.26/include/pkcs11-helper-1.0/pkcs11h-engines.h:107:9: [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. void (*usleep) (unsigned long usec); data/pkcs11-helper-1.26/lib/_pkcs11h-crypto-nss.c:173: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). if (strlen (cert->subjectName) >= dn_max) { data/pkcs11-helper-1.26/lib/pkcs11h-certificate.c:412: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). if (strlen (certificate_id->displayName) == 0) { data/pkcs11-helper-1.26/lib/pkcs11h-certificate.c:413:3: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy ( data/pkcs11-helper-1.26/lib/pkcs11h-certificate.c:424:2: [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 ( data/pkcs11-helper-1.26/lib/pkcs11h-certificate.c:427: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). sizeof (certificate_id->displayName)-1-strlen (certificate_id->displayName) data/pkcs11-helper-1.26/lib/pkcs11h-certificate.c:429:2: [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 ( data/pkcs11-helper-1.26/lib/pkcs11h-certificate.c:432: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). sizeof (certificate_id->displayName)-1-strlen (certificate_id->displayName) data/pkcs11-helper-1.26/lib/pkcs11h-core.c:700:2: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy ( data/pkcs11-helper-1.26/lib/pkcs11h-core.c:706:2: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy ( data/pkcs11-helper-1.26/lib/pkcs11h-core.c:709:4: [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 (provider_location) < sizeof (provider->manufacturerID) ? data/pkcs11-helper-1.26/lib/pkcs11h-core.c:711:22: [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). provider_location+strlen (provider_location)-sizeof (provider->manufacturerID)+1 data/pkcs11-helper-1.26/lib/pkcs11h-data.c:70:68: [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). {CKA_APPLICATION, (void *)application, application == NULL ? 0 : strlen (application)}, data/pkcs11-helper-1.26/lib/pkcs11h-data.c:71:50: [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). {CKA_LABEL, (void *)label, label == NULL ? 0 : strlen (label)} data/pkcs11-helper-1.26/lib/pkcs11h-data.c:310: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). {CKA_APPLICATION, (void *)application, strlen (application)}, data/pkcs11-helper-1.26/lib/pkcs11h-data.c:311: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). {CKA_LABEL, (void *)label, strlen (label)}, data/pkcs11-helper-1.26/lib/pkcs11h-mem.c:103:3: [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 (src)+1 data/pkcs11-helper-1.26/lib/pkcs11h-serialization.c:254:2: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy ( data/pkcs11-helper-1.26/lib/pkcs11h-serialization.c:416:36: [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). certificate_id->attrCKA_ID_size = strlen (p)/2; data/pkcs11-helper-1.26/lib/pkcs11h-session.c:1048: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). lPINLength = strlen (pin); data/pkcs11-helper-1.26/lib/pkcs11h-sys.c:73:2: [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 (usec); data/pkcs11-helper-1.26/lib/pkcs11h-threading.c:94:24: [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. _g_pkcs11h_sys_engine.usleep (milli*1000); data/pkcs11-helper-1.26/lib/pkcs11h-token.c:189:2: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy ( data/pkcs11-helper-1.26/lib/pkcs11h-token.c:356: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). pin_size = strlen (pin); data/pkcs11-helper-1.26/tests/test-certificate/test-certificate.c:81: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 (buf[strlen (buf)-1] == '\n') { data/pkcs11-helper-1.26/tests/test-certificate/test-certificate.c:82: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). buf[strlen (buf)-1] = '\0'; data/pkcs11-helper-1.26/tests/test-certificate/test-certificate.c:84: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 (buf[strlen (buf)-1] == '\r') { data/pkcs11-helper-1.26/tests/test-certificate/test-certificate.c:85: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). buf[strlen (buf)-1] = '\0'; data/pkcs11-helper-1.26/tests/test-certificate/test-certificate.c:129:2: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy (pin, p, pin_max); data/pkcs11-helper-1.26/tests/test-openssl/test-openssl.c:82: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 (buf[strlen (buf)-1] == '\n') { data/pkcs11-helper-1.26/tests/test-openssl/test-openssl.c:83: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). buf[strlen (buf)-1] = '\0'; data/pkcs11-helper-1.26/tests/test-openssl/test-openssl.c:85: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 (buf[strlen (buf)-1] == '\r') { data/pkcs11-helper-1.26/tests/test-openssl/test-openssl.c:86: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). buf[strlen (buf)-1] = '\0'; data/pkcs11-helper-1.26/tests/test-openssl/test-openssl.c:130:2: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy (pin, p, pin_max); ANALYSIS SUMMARY: Hits = 75 Lines analyzed = 18439 in approximately 0.63 seconds (29076 lines/second) Physical Source Lines of Code (SLOC) = 12693 Hits@level = [0] 88 [1] 34 [2] 31 [3] 1 [4] 9 [5] 0 Hits@level+ = [0+] 163 [1+] 75 [2+] 41 [3+] 10 [4+] 9 [5+] 0 Hits/KSLOC@level+ = [0+] 12.8417 [1+] 5.90877 [2+] 3.23013 [3+] 0.787836 [4+] 0.709052 [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.