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/ccid-1.4.33/MacOSX/wintypes.h Examining data/ccid-1.4.33/MacOSX/debuglog.h Examining data/ccid-1.4.33/MacOSX/winscard.h Examining data/ccid-1.4.33/MacOSX/pcsclite.h Examining data/ccid-1.4.33/MacOSX/reader.h Examining data/ccid-1.4.33/MacOSX/ifdhandler.h Examining data/ccid-1.4.33/src/defs.h Examining data/ccid-1.4.33/src/utils.h Examining data/ccid-1.4.33/src/debug.h Examining data/ccid-1.4.33/src/ccid_serial.c Examining data/ccid-1.4.33/src/debug.c Examining data/ccid-1.4.33/src/simclist.h Examining data/ccid-1.4.33/src/strlcpycat.h Examining data/ccid-1.4.33/src/ccid_serial.h Examining data/ccid-1.4.33/src/ccid.h Examining data/ccid-1.4.33/src/ccid_usb.c Examining data/ccid-1.4.33/src/ccid_ifdhandler.h Examining data/ccid-1.4.33/src/ccid.c Examining data/ccid-1.4.33/src/utils.c Examining data/ccid-1.4.33/src/tokenparser.c Examining data/ccid-1.4.33/src/misc.h Examining data/ccid-1.4.33/src/parser.h Examining data/ccid-1.4.33/src/commands.c Examining data/ccid-1.4.33/src/ifdhandler.c Examining data/ccid-1.4.33/src/simclist.c Examining data/ccid-1.4.33/src/towitoko/atr.c Examining data/ccid-1.4.33/src/towitoko/atr.h Examining data/ccid-1.4.33/src/towitoko/defines.h Examining data/ccid-1.4.33/src/towitoko/pps.c Examining data/ccid-1.4.33/src/towitoko/pps.h Examining data/ccid-1.4.33/src/strlcpy.c Examining data/ccid-1.4.33/src/parse.c Examining data/ccid-1.4.33/src/commands.h Examining data/ccid-1.4.33/src/ccid_usb.h Examining data/ccid-1.4.33/src/openct/checksum.h Examining data/ccid-1.4.33/src/openct/buffer.c Examining data/ccid-1.4.33/src/openct/checksum.c Examining data/ccid-1.4.33/src/openct/proto-t1.h Examining data/ccid-1.4.33/src/openct/proto-t1.c Examining data/ccid-1.4.33/src/openct/buffer.h Examining data/ccid-1.4.33/contrib/Kobil_mIDentity_switch/Kobil_mIDentity_switch.c Examining data/ccid-1.4.33/contrib/RSA_SecurID/RSA_SecurID_getpasswd.c Examining data/ccid-1.4.33/examples/scardcontrol.c Examining data/ccid-1.4.33/examples/PCSCv2part10.h Examining data/ccid-1.4.33/examples/PCSCv2part10.c FINAL RESULTS: data/ccid-1.4.33/MacOSX/debuglog.h:121:24: [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/ccid-1.4.33/contrib/RSA_SecurID/RSA_SecurID_getpasswd.c:38:2: [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(text ": %s (0x%"LF"X)\n", pcsc_stringify_error(rv), rv); \ data/ccid-1.4.33/examples/scardcontrol.c:67:2: [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(text ": " RED "%s (0x%"LF"X)\n" NORMAL, pcsc_stringify_error(rv), rv); \ data/ccid-1.4.33/examples/scardcontrol.c:71:2: [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(text ": " BLUE "OK\n\n" NORMAL); data/ccid-1.4.33/examples/scardcontrol.c:75:2: [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(text ": " RED "%s (0x%"LF"X)\n" NORMAL, pcsc_stringify_error(rv), rv); \ data/ccid-1.4.33/examples/scardcontrol.c:77:2: [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(text ": " BLUE "OK\n\n" NORMAL); data/ccid-1.4.33/examples/scardcontrol.c:80:2: [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("%s: " GREEN "%s\n" NORMAL, text, value) data/ccid-1.4.33/examples/scardcontrol.c:83:2: [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("%s: " GREEN "%d\n" NORMAL, text, value) data/ccid-1.4.33/examples/scardcontrol.c:86:2: [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("%s: " RED "%d\n" NORMAL, text, value) data/ccid-1.4.33/examples/scardcontrol.c:89:2: [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("%s: " GREEN "0x%02X\n" NORMAL, text, value) data/ccid-1.4.33/examples/scardcontrol.c:92:2: [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("%s: " GREEN "0x%04X\n" NORMAL, text, value) data/ccid-1.4.33/examples/scardcontrol.c:146: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(" sFirmwareID: " GREEN); data/ccid-1.4.33/examples/scardcontrol.c:149: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(NORMAL "\n"); data/ccid-1.4.33/examples/scardcontrol.c:261:2: [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(MAGENTA "THIS PROGRAM IS NOT DESIGNED AS A TESTING TOOL!\n"); data/ccid-1.4.33/examples/scardcontrol.c:262:2: [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("Do NOT use it unless you really know what you do.\n\n" NORMAL); data/ccid-1.4.33/examples/scardcontrol.c:337:2: [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("Using reader: " GREEN "%s\n" NORMAL, readers[reader_nb]); data/ccid-1.4.33/examples/scardcontrol.c:340:2: [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(" Protocol: " GREEN "%"LF"d\n" NORMAL, dwActiveProtocol); data/ccid-1.4.33/examples/scardcontrol.c:352:2: [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(" Firmware: " GREEN); data/ccid-1.4.33/examples/scardcontrol.c:355:2: [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(NORMAL "\n"); data/ccid-1.4.33/examples/scardcontrol.c:368:2: [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(" TLV (%"LF"d): " GREEN, length); data/ccid-1.4.33/examples/scardcontrol.c:371:2: [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(NORMAL "\n"); data/ccid-1.4.33/examples/scardcontrol.c:428:3: [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("GET_TLV_PROPERTIES (" GREEN "%"LF"d" NORMAL "): " GREEN, length); data/ccid-1.4.33/examples/scardcontrol.c:431:3: [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(NORMAL "\n"); data/ccid-1.4.33/examples/scardcontrol.c:497:3: [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("PIN PROPERTIES (" GREEN "%"LF"d" NORMAL "): " GREEN, length); data/ccid-1.4.33/examples/scardcontrol.c:500:3: [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(NORMAL "\n"); data/ccid-1.4.33/examples/scardcontrol.c:522:3: [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(" Firmware: " GREEN); data/ccid-1.4.33/examples/scardcontrol.c:525:3: [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(NORMAL "\n"); data/ccid-1.4.33/examples/scardcontrol.c:687:2: [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(error ? RED : GREEN); data/ccid-1.4.33/examples/scardcontrol.c:692:2: [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(NORMAL "\n"); data/ccid-1.4.33/examples/scardcontrol.c:850:2: [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(error ? RED : GREEN); data/ccid-1.4.33/examples/scardcontrol.c:855:2: [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(NORMAL "\n"); data/ccid-1.4.33/src/debug.c:68:8: [4] (format) vsnprintf: If format strings can be influenced by an attacker, they can be exploited, and note that sprintf variations do not always \0-terminate (CWE-134). Use a constant for the format specification. (void)vsnprintf(debug_buffer, sizeof debug_buffer, fmt, argptr); data/ccid-1.4.33/src/debug.c:200:8: [4] (format) vsnprintf: If format strings can be influenced by an attacker, they can be exploited, and note that sprintf variations do not always \0-terminate (CWE-134). Use a constant for the format specification. (void)vsnprintf(debug_buffer, sizeof debug_buffer, fmt, argptr); data/ccid-1.4.33/src/parse.c:108:11: [4] (format) fprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. (void)fprintf(stderr, data/ccid-1.4.33/src/parse.c:118:19: [4] (format) fprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. (void)fprintf(stderr, data/ccid-1.4.33/src/parse.c:136:11: [4] (format) fprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. (void)fprintf(stderr, data/ccid-1.4.33/src/parse.c:142:10: [4] (format) fprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. (void)fprintf(stderr, data/ccid-1.4.33/src/parse.c:151:10: [4] (format) fprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. (void)fprintf(stderr, " iProduct: " BLUE "%s\n" NORMAL, buffer); data/ccid-1.4.33/src/parse.c:169:11: [4] (format) fprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. (void)fprintf(stderr, RED " NOT a CCID/ICCD device\n" NORMAL); data/ccid-1.4.33/src/parse.c:175:10: [4] (format) fprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. (void)fprintf(stderr, MAGENTA " Found a possibly CCID/ICCD device (bInterfaceClass = 0xFF). Use %s -p\n" NORMAL, argv[0]); data/ccid-1.4.33/src/parse.c:178:9: [4] (format) fprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. (void)fprintf(stderr, data/ccid-1.4.33/src/parse.c:205:11: [4] (format) fprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. (void)fprintf(stderr, data/ccid-1.4.33/src/parse.c:268:10: [4] (format) fprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. (void)fprintf(stderr, data/ccid-1.4.33/src/parse.c:428:11: [4] (format) fprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. (void)fprintf(stderr, data/ccid-1.4.33/src/ccid.c:405:12: [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. lang = getenv("LANG"); data/ccid-1.4.33/src/debug.c:134:10: [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. term = getenv("TERM"); data/ccid-1.4.33/src/ifdhandler.c:2042:6: [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. e = getenv("LIBCCID_ifdLogLevel"); data/ccid-1.4.33/contrib/Kobil_mIDentity_switch/Kobil_mIDentity_switch.c:87: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. unsigned char switchCmd[10]; data/ccid-1.4.33/contrib/RSA_SecurID/RSA_SecurID_getpasswd.c:55: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. unsigned char bRecvBuffer[MAX_BUFFER_SIZE]; data/ccid-1.4.33/contrib/RSA_SecurID/RSA_SecurID_getpasswd.c:131: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(cmd3+5, bRecvBuffer, 4); data/ccid-1.4.33/examples/PCSCv2part10.c:85: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. unsigned char buffer[MAX_BUFFER_SIZE]; data/ccid-1.4.33/examples/scardcontrol.c:223: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 pbReader[MAX_READERNAME] = ""; data/ccid-1.4.33/examples/scardcontrol.c:226: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. unsigned char bSendBuffer[MAX_BUFFER_SIZE]; data/ccid-1.4.33/examples/scardcontrol.c:227: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. unsigned char bRecvBuffer[MAX_BUFFER_SIZE]; data/ccid-1.4.33/examples/scardcontrol.c:325: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). reader_nb = atoi(argv[1]); data/ccid-1.4.33/examples/scardcontrol.c:587: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(bSendBuffer, "\x00\xA4\x04\x00\x06\xA0\x00\x00\x00\x18\xFF", data/ccid-1.4.33/examples/scardcontrol.c:672: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 in[40]; /* 4 digits + \n + \0 */ data/ccid-1.4.33/examples/scardcontrol.c:698: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(bSendBuffer, "\x00\x40\x00\x00\xFF", data/ccid-1.4.33/examples/scardcontrol.c:716: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(bSendBuffer, "\x00\x40\x00\x00\xFF", data/ccid-1.4.33/examples/scardcontrol.c:828:5: [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 in[40]; /* 4 digits + \n + \0 */ data/ccid-1.4.33/examples/scardcontrol.c:861: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(bSendBuffer, "\x00\x40\x00\x00\xFF", data/ccid-1.4.33/examples/scardcontrol.c:879: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(bSendBuffer, "\x00\x40\x00\x00\xFF", data/ccid-1.4.33/src/ccid.c:120: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 tmp[MAX_ATR_SIZE]; data/ccid-1.4.33/src/ccid.c:132: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 tmp[MAX_ATR_SIZE]; data/ccid-1.4.33/src/ccid.c:266:14: [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 res[10]; data/ccid-1.4.33/src/ccid.c:285:14: [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 cmd[L10N_HEADER_SIZE + L10N_NB_STRING * L10N_STRING_MAX_SIZE]; data/ccid-1.4.33/src/ccid.c:286:14: [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 res[20]; data/ccid-1.4.33/src/ccid.c:525:14: [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 res[20]; data/ccid-1.4.33/src/ccid.c:586: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 var_text[30]; data/ccid-1.4.33/src/ccid.h:327: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. unsigned char RFUb2[2]; data/ccid-1.4.33/src/ccid.h: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. unsigned char RFUb4[3]; data/ccid-1.4.33/src/ccid.h:357: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. unsigned char RFUb6[3]; data/ccid-1.4.33/src/ccid_serial.c:122: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. unsigned char buffer[GEMPCTWIN_MAXBUF]; data/ccid-1.4.33/src/ccid_serial.c:177: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. unsigned char low_level_buffer[GEMPCTWIN_MAXBUF]; data/ccid-1.4.33/src/ccid_serial.c:196: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(low_level_buffer+2, buffer, length); data/ccid-1.4.33/src/ccid_serial.c:366: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(buffer, serialDevice[reader_index].buffer + offset, length); data/ccid-1.4.33/src/ccid_serial.c:379:4: [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(buffer, serialDevice[reader_index].buffer + offset, data/ccid-1.4.33/src/ccid_serial.c:391: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(buffer + present, serialDevice[reader_index].buffer, data/ccid-1.4.33/src/ccid_serial.c:471: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 dev_name[FILENAME_MAX]; data/ccid-1.4.33/src/ccid_serial.c:570:8: [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(ptr, SerialCustomDataRates, data/ccid-1.4.33/src/ccid_serial.c:694: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 reader_name[255] = "GemPCTwin"; data/ccid-1.4.33/src/ccid_serial.c:719:28: [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). serialDevice[reader].fd = open(dev_name, O_RDWR | O_NOCTTY); data/ccid-1.4.33/src/ccid_serial.c:784: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 pcbuffer[SIZE_GET_SLOT_STATUS]; data/ccid-1.4.33/src/ccid_serial.c:816:13: [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 rx_buffer[50]; data/ccid-1.4.33/src/ccid_serial.c:850: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 tx_buffer[1]; data/ccid-1.4.33/src/ccid_serial.c:851: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 rx_buffer[50]; data/ccid-1.4.33/src/ccid_serial.c:878: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 rx_buffer[50]; data/ccid-1.4.33/src/ccid_usb.c:71: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. unsigned char buffer[CCID_INTERRUPT_SIZE]; data/ccid-1.4.33/src/ccid_usb.c:217: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 infofile[FILENAME_MAX]; data/ccid-1.4.33/src/ccid_usb.c:519:9: [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(ptr, SerialCustomDataRates, data/ccid-1.4.33/src/ccid_usb.c:735:15: [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[128]; data/ccid-1.4.33/src/ccid_usb.c:749:15: [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 iManufacturer[128]; data/ccid-1.4.33/src/ccid_usb.c:1205: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. unsigned char buffer[256*sizeof(int)]; /* maximum is 256 records */ data/ccid-1.4.33/src/ccid_usb.c:1319: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. unsigned char buffer[8]; data/ccid-1.4.33/src/ccid_usb.c:1435: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. unsigned char buffer[CCID_INTERRUPT_SIZE]; data/ccid-1.4.33/src/ccid_usb.c:1570:4: [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(msExt->buffer, buffer, actual_length); data/ccid-1.4.33/src/ccid_usb.c:1647: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. unsigned char buffer[CCID_INTERRUPT_SIZE]; data/ccid-1.4.33/src/ccid_usb.c:1682: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(buffer, msExt->buffer, sizeof buffer); data/ccid-1.4.33/src/commands.c:97: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. unsigned char cmd[10]; data/ccid-1.4.33/src/commands.c:109: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 pcbuffer[SIZE_GET_SLOT_STATUS]; data/ccid-1.4.33/src/commands.c:139: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 tmp[MAX_ATR_SIZE+1]; data/ccid-1.4.33/src/commands.c:179: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(buffer, tmp+1, *nlength); data/ccid-1.4.33/src/commands.c:250:13: [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 res_tmp[1]; data/ccid-1.4.33/src/commands.c:309: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. unsigned char cmd[11+14+TxLength]; data/ccid-1.4.33/src/commands.c:423: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 sdata[T1_BUFFER_SIZE]; data/ccid-1.4.33/src/commands.c:440: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(TxBuffer + offsetof(PIN_VERIFY_STRUCTURE, bTeoPrologue), data/ccid-1.4.33/src/commands.c: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 res_tmp[1]; data/ccid-1.4.33/src/commands.c:544:14: [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 sblk[1]; /* we only need 1 byte of data */ data/ccid-1.4.33/src/commands.c:642: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. unsigned char cmd[11+19+TxLength]; data/ccid-1.4.33/src/commands.c:782: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 sdata[T1_BUFFER_SIZE]; data/ccid-1.4.33/src/commands.c:799: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(TxBuffer + offsetof(PIN_MODIFY_STRUCTURE, bTeoPrologue), data/ccid-1.4.33/src/commands.c:959: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(&cmd_in[10], TxBuffer, TxLength); data/ccid-1.4.33/src/commands.c:1027: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(RxBuffer, &cmd_out[10], length_out); data/ccid-1.4.33/src/commands.c:1046: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. unsigned char cmd[10]; data/ccid-1.4.33/src/commands.c:1073: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 buffer[3]; data/ccid-1.4.33/src/commands.c:1135: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. unsigned char cmd[10]; data/ccid-1.4.33/src/commands.c:1145: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 status[1]; data/ccid-1.4.33/src/commands.c:1185: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 buffer_tmp[3]; data/ccid-1.4.33/src/commands.c:1318: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. unsigned char cmd[10+tx_length]; /* CCID + APDU buffer */ data/ccid-1.4.33/src/commands.c:1373: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(cmd+10, tx_buffer, tx_length); data/ccid-1.4.33/src/commands.c:1390: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. unsigned char cmd[10+CMD_BUF_SIZE]; /* CCID + APDU buffer */ data/ccid-1.4.33/src/commands.c:1400: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 pcbuffer[SIZE_GET_SLOT_STATUS]; data/ccid-1.4.33/src/commands.c:1427: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 rx_tmp[4]; data/ccid-1.4.33/src/commands.c:1461:4: [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(old_rx_buffer, rx_buffer, min(r, old_rx_length)); data/ccid-1.4.33/src/commands.c:1598: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(rx_buffer, cmd+10, length); data/ccid-1.4.33/src/commands.c:1858: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 tmp_buf[512]; data/ccid-1.4.33/src/commands.c:1865: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(*rcv_buf, *in_buf, proc_len); data/ccid-1.4.33/src/commands.c:1877: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(*rcv_buf, *in_buf, *in_len); data/ccid-1.4.33/src/commands.c:1934: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(*rcv_buf, tmp_buf, remain_len); data/ccid-1.4.33/src/commands.c:2016: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. unsigned char cmd[5]; data/ccid-1.4.33/src/commands.c:2017: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. unsigned char tmp_buf[512]; data/ccid-1.4.33/src/commands.c:2027: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 pcbuffer[SIZE_GET_SLOT_STATUS]; data/ccid-1.4.33/src/commands.c:2042:4: [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(cmd, snd_buf, 4); data/ccid-1.4.33/src/commands.c:2048:4: [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(cmd, snd_buf, 5); data/ccid-1.4.33/src/commands.c:2129: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(cmd, snd_buf, 4); data/ccid-1.4.33/src/commands.c:2135: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(cmd, snd_buf, 5); data/ccid-1.4.33/src/commands.c:2261: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. unsigned char cmd[10+length]; /* CCID + APDU buffer */ data/ccid-1.4.33/src/commands.c:2274: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(cmd+10, buffer, length); data/ccid-1.4.33/src/debug.c:48: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 debug_buffer[3 * 80]; /* up to 3 lines of 80 characters */ data/ccid-1.4.33/src/debug.c:78: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, debug_buffer[len*3 + strlen(msg) +1]; data/ccid-1.4.33/src/debug.c:100: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 debug_buffer[3 * 80]; /* up to 3 lines of 80 characters */ data/ccid-1.4.33/src/debug.c:216: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, debug_buffer[len*3 + strlen(msg) +1]; data/ccid-1.4.33/src/defs.h:32: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. unsigned char pcATRBuffer[MAX_ATR_SIZE]; data/ccid-1.4.33/src/ifdhandler.c:160: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 pcbuffer[SIZE_GET_SLOT_STATUS]; data/ccid-1.4.33/src/ifdhandler.c:394: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(Value, CcidSlots[reader_index].pcATRBuffer, *Length); data/ccid-1.4.33/src/ifdhandler.c:1152: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. unsigned char pcbuffer[10+MAX_ATR_SIZE]; data/ccid-1.4.33/src/ifdhandler.c:1246:4: [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(Atr, pcbuffer, *AtrLength); data/ccid-1.4.33/src/ifdhandler.c:1247:4: [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(CcidSlots[reader_index].pcATRBuffer, pcbuffer, *AtrLength); data/ccid-1.4.33/src/ifdhandler.c:1330:4: [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(RxBuffer, "KOBIL systems\220\0", 15); data/ccid-1.4.33/src/ifdhandler.c:1339:4: [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(RxBuffer, "IDToken\220\0", 9); data/ccid-1.4.33/src/ifdhandler.c:1350:16: [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. *RxLength = sprintf((char *)RxBuffer, "%X.%02X", data/ccid-1.4.33/src/ifdhandler.c:1362:4: [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(RxBuffer, DRIVER_VERSION, sizeof DRIVER_VERSION -1); data/ccid-1.4.33/src/ifdhandler.c:1632:13: [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 firmware[256]; data/ccid-1.4.33/src/ifdhandler.c:1644: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(&RxBuffer[p], firmware, len); data/ccid-1.4.33/src/ifdhandler.c:1858: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. unsigned char pcbuffer[SIZE_GET_SLOT_STATUS]; data/ccid-1.4.33/src/ifdhandler.c:1950: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 res[10]; data/ccid-1.4.33/src/ifdhandler.c:2003: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 infofile[FILENAME_MAX]; data/ccid-1.4.33/src/openct/buffer.c:36: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(mem, bp->base + bp->head, len); data/ccid-1.4.33/src/openct/buffer.c:49: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(bp->base + bp->tail, mem, len); data/ccid-1.4.33/src/openct/proto-t1.c:161: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. unsigned char sdata[T1_BUFFER_SIZE], sblk[5]; data/ccid-1.4.33/src/openct/proto-t1.c:589: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(block + 3, ct_buf_head(bp), len); data/ccid-1.4.33/src/openct/proto-t1.c:597: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(t1->previous_block, block, 4); data/ccid-1.4.33/src/openct/proto-t1.c:609: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(block, t1 -> previous_block, 4); data/ccid-1.4.33/src/openct/proto-t1.c:631: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. unsigned char csum[2]; data/ccid-1.4.33/src/openct/proto-t1.c:746: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. unsigned char sdata[T1_BUFFER_SIZE]; data/ccid-1.4.33/src/openct/proto-t1.c:751: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. unsigned char snd_buf[1]; data/ccid-1.4.33/src/openct/proto-t1.h:69: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. unsigned char previous_block[4]; /* to store the last R-block */ data/ccid-1.4.33/src/parse.c:67: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. unsigned char buffer[256]; data/ccid-1.4.33/src/parse.c:254: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. unsigned char buffer[256*sizeof(int)]; /* maximum is 256 records */ data/ccid-1.4.33/src/simclist.c:520:9: [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(lent->data, data, datalen); data/ccid-1.4.33/src/simclist.c:1129:10: [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). fd = open(filename, O_RDONLY, 0); data/ccid-1.4.33/src/simclist.c:1428:10: [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). fd = open(filename, oflag, mode); data/ccid-1.4.33/src/simclist.c:1440:10: [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). fd = open(filename, O_RDONLY, 0); data/ccid-1.4.33/src/tokenparser.c:1829: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(elt->key, &pcToken[5], len-1); data/ccid-1.4.33/src/tokenparser.c:1861: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(value, &pcToken[8], len-1); data/ccid-1.4.33/src/tokenparser.c:1941:9: [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(fileName, "r"); data/ccid-1.4.33/src/towitoko/atr.c:151: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 (atr->hb, atr_buffer + pointer + 1, atr->hbn); data/ccid-1.4.33/src/towitoko/pps.c:83: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 (params, confirm, len_confirm); data/ccid-1.4.33/src/utils.c:88: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(&value, buf, sizeof value); data/ccid-1.4.33/src/utils.c:98: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(&value, buf, sizeof value); data/ccid-1.4.33/src/utils.c:106: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(buf, &value, sizeof value); data/ccid-1.4.33/src/utils.c:112: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(buf, &value, sizeof value); data/ccid-1.4.33/examples/scardcontrol.c:292:10: [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). ptr += strlen(ptr)+1; data/ccid-1.4.33/examples/scardcontrol.c:318:10: [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). ptr += strlen(ptr)+1; data/ccid-1.4.33/src/ccid_serial.c:446:8: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). rv = read(fd, buffer + already_read, buffer_length - already_read); data/ccid-1.4.33/src/ccid_serial.c:823:11: [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(250*1000); data/ccid-1.4.33/src/commands.c:403: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(250*1000); data/ccid-1.4.33/src/commands.c:1164:10: [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(1000 * 10); data/ccid-1.4.33/src/commands.c:1489:11: [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(delay * 1000 * 10); data/ccid-1.4.33/src/debug.c:78: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). char *c, debug_buffer[len*3 + strlen(msg) +1]; data/ccid-1.4.33/src/debug.c:216: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). char *c, debug_buffer[len*3 + strlen(msg) +1]; data/ccid-1.4.33/src/ifdhandler.c:334:8: [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(timeout * 1000); data/ccid-1.4.33/src/ifdhandler.c:512: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). *Length = strlen((char *)Value) +1; data/ccid-1.4.33/src/ifdhandler.c:605: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). *Length = strlen((char *)Value)+1; data/ccid-1.4.33/src/simclist.c:98:57: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if (read(fd, msgbuf, msglen) != msglen) { \ data/ccid-1.4.33/src/simclist.c:1513:51: [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). size_t list_meter_string(const void *el) { return strlen((const char *)el) + 1; } data/ccid-1.4.33/src/tokenparser.c:635:14: [1] (buffer) getc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). (c = getc( yyin )) != EOF && c != '\n'; ++n ) \ data/ccid-1.4.33/src/tokenparser.c:1559: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). return yy_scan_bytes( yystr, (int) strlen(yystr) ); ANALYSIS SUMMARY: Hits = 198 Lines analyzed = 19322 in approximately 0.58 seconds (33324 lines/second) Physical Source Lines of Code (SLOC) = 11499 Hits@level = [0] 261 [1] 16 [2] 135 [3] 3 [4] 44 [5] 0 Hits@level+ = [0+] 459 [1+] 198 [2+] 182 [3+] 47 [4+] 44 [5+] 0 Hits/KSLOC@level+ = [0+] 39.9165 [1+] 17.2189 [2+] 15.8275 [3+] 4.08731 [4+] 3.82642 [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.