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/r-cran-pbdzmq-0.3.3.1+dfsg/src/R_zmq_poll.c Examining data/r-cran-pbdzmq-0.3.3.1+dfsg/src/zzz.c Examining data/r-cran-pbdzmq-0.3.3.1+dfsg/src/R_zmq_transfer.c Examining data/r-cran-pbdzmq-0.3.3.1+dfsg/src/R_zmq_utility.c Examining data/r-cran-pbdzmq-0.3.3.1+dfsg/src/R_zmq_context.c Examining data/r-cran-pbdzmq-0.3.3.1+dfsg/src/R_zmq_socket.c Examining data/r-cran-pbdzmq-0.3.3.1+dfsg/src/shellexec_wcc.c Examining data/r-cran-pbdzmq-0.3.3.1+dfsg/src/R_zmq_sendrecv.c Examining data/r-cran-pbdzmq-0.3.3.1+dfsg/src/R_zmq.h Examining data/r-cran-pbdzmq-0.3.3.1+dfsg/src/R_zmq_message.c FINAL RESULTS: data/r-cran-pbdzmq-0.3.3.1+dfsg/src/R_zmq_message.c:56: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(zmq_msg_data(&msg), RAW(R_rmsg), C_rmsg_length); data/r-cran-pbdzmq-0.3.3.1+dfsg/src/R_zmq_message.c:101: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(RAW(R_rmsg), zmq_msg_data(&msg), C_rmsg_length); data/r-cran-pbdzmq-0.3.3.1+dfsg/src/R_zmq_transfer.c:61:18: [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 *infile = fopen(CHARPT(R_filename, 0), "r"); data/r-cran-pbdzmq-0.3.3.1+dfsg/src/R_zmq_transfer.c:113:19: [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 *outfile = fopen(CHARPT(R_filename, 0), "w"); data/r-cran-pbdzmq-0.3.3.1+dfsg/src/R_zmq_utility.c:29: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 ver[36]; data/r-cran-pbdzmq-0.3.3.1+dfsg/src/R_zmq_utility.c:36:10: [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. chars = sprintf(ver, "%d.%d.%d", major, minor, patch); data/r-cran-pbdzmq-0.3.3.1+dfsg/src/shellexec_wcc.c:38:9: [2] (buffer) wchar_t: 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. static wchar_t filename[BSIZE + 1]; data/r-cran-pbdzmq-0.3.3.1+dfsg/src/shellexec_wcc.c:76:2: [2] (buffer) wchar_t: 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. wchar_t home2[10000], *p; data/r-cran-pbdzmq-0.3.3.1+dfsg/src/R_zmq_socket.c:113:20: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). C_option_len = strlen(C_option_value); data/r-cran-pbdzmq-0.3.3.1+dfsg/src/R_zmq_socket.c:150:20: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). C_option_len = strlen(C_option_value); data/r-cran-pbdzmq-0.3.3.1+dfsg/src/shellexec_wcc.c:44: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(CHAR(fn))){ data/r-cran-pbdzmq-0.3.3.1+dfsg/src/shellexec_wcc.c:45:3: [1] (buffer) wcscpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using a function version that stops copying at the end of the buffer. Risk is low because the source is a constant character. wcscpy(filename, L""); data/r-cran-pbdzmq-0.3.3.1+dfsg/src/shellexec_wcc.c:60: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). inb = strlen(inbuf)+1; outb = 2*BSIZE; data/r-cran-pbdzmq-0.3.3.1+dfsg/src/shellexec_wcc.c:82:3: [1] (buffer) wcsncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). wcsncpy(home2, home, 10000); ANALYSIS SUMMARY: Hits = 14 Lines analyzed = 926 in approximately 0.06 seconds (16142 lines/second) Physical Source Lines of Code (SLOC) = 675 Hits@level = [0] 1 [1] 6 [2] 8 [3] 0 [4] 0 [5] 0 Hits@level+ = [0+] 15 [1+] 14 [2+] 8 [3+] 0 [4+] 0 [5+] 0 Hits/KSLOC@level+ = [0+] 22.2222 [1+] 20.7407 [2+] 11.8519 [3+] 0 [4+] 0 [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.