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-rcurl-1.98-1.2/src/CurlOptEnums.h Examining data/r-cran-rcurl-1.98-1.2/src/CurlInfoEnums.h Examining data/r-cran-rcurl-1.98-1.2/src/base64.c Examining data/r-cran-rcurl-1.98-1.2/src/curl_base64.c Examining data/r-cran-rcurl-1.98-1.2/src/CURLOptTable.h Examining data/r-cran-rcurl-1.98-1.2/src/curl.c Examining data/r-cran-rcurl-1.98-1.2/src/CurlErrorEnums.h Examining data/r-cran-rcurl-1.98-1.2/src/CURLINFOTable.h Examining data/r-cran-rcurl-1.98-1.2/src/myUTF8.c Examining data/r-cran-rcurl-1.98-1.2/src/Rcurl.h Examining data/r-cran-rcurl-1.98-1.2/src/memoryManagement.c Examining data/r-cran-rcurl-1.98-1.2/src/enums.c Examining data/r-cran-rcurl-1.98-1.2/src/json.c Examining data/r-cran-rcurl-1.98-1.2/src/curlInit.c Examining data/r-cran-rcurl-1.98-1.2/inst/examples/post.c Examining data/r-cran-rcurl-1.98-1.2/inst/examples/curl.c Examining data/r-cran-rcurl-1.98-1.2/inst/enums/Renums.c FINAL RESULTS: data/r-cran-rcurl-1.98-1.2/src/base64.c:29:7: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(text, RAW(r_text), len); data/r-cran-rcurl-1.98-1.2/src/base64.c:42:6: [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_ans), ans, len); data/r-cran-rcurl-1.98-1.2/src/base64.c:78:6: [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_ans), ans, len); data/r-cran-rcurl-1.98-1.2/src/curl.c:6: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. static char RCurlErrorBuffer[1000] = "<not set>"; data/r-cran-rcurl-1.98-1.2/src/curl.c:285:11: [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). ans = fopen(filename, mode); data/r-cran-rcurl-1.98-1.2/src/curl.c:310: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(ptr, buf->cur, numBytes); data/r-cran-rcurl-1.98-1.2/src/curl.c:347:6: [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, RAW(ans), len); data/r-cran-rcurl-1.98-1.2/src/curl.c:353:6: [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, str, len); data/r-cran-rcurl-1.98-1.2/src/curl.c:931: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_ans), data->data, data->len * sizeof(unsigned char )); data/r-cran-rcurl-1.98-1.2/src/curl.c:954: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(data->cursor, buffer, total); data/r-cran-rcurl-1.98-1.2/src/curl.c:1007: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(tmp, buffer, size*nmemb); data/r-cran-rcurl-1.98-1.2/src/curl.c:1130: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(buf, msg, len); data/r-cran-rcurl-1.98-1.2/src/curl.c:1138: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(CHAR(str), msg, len); data/r-cran-rcurl-1.98-1.2/src/curl_base64.c:100: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 lastQuantum[3]; data/r-cran-rcurl-1.98-1.2/src/curl_base64.c:162: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 ibuf[3]; data/r-cran-rcurl-1.98-1.2/src/curl_base64.c:163: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 obuf[4]; data/r-cran-rcurl-1.98-1.2/src/enums.c:5:3: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char name[40]; data/r-cran-rcurl-1.98-1.2/src/json.c:133:7: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char unicode_buf[ 5 ]; /* to hold 4 digit hex (to prevent scanning a 5th digit accidentally */ data/r-cran-rcurl-1.98-1.2/src/myUTF8.c:52: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 currtext[1010], *ct = currtext; data/r-cran-rcurl-1.98-1.2/src/myUTF8.c:53: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 st0[MAXELTSIZE]; data/r-cran-rcurl-1.98-1.2/src/myUTF8.c:238: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 str[6]; data/r-cran-rcurl-1.98-1.2/src/base64.c:64:9: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). n = strlen(text); data/r-cran-rcurl-1.98-1.2/src/curl.c:352:12: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). len = strlen(str); data/r-cran-rcurl-1.98-1.2/src/curl.c:458: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). CURLFORM_BUFFERLENGTH, strlen(buf), data/r-cran-rcurl-1.98-1.2/src/curl.c:466: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). CURLFORM_BUFFERLENGTH, strlen(buf), data/r-cran-rcurl-1.98-1.2/src/curl.c:504:29: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). CURLFORM_NAMELENGTH, strlen(CHAR(name)), data/r-cran-rcurl-1.98-1.2/src/curl.c:723:5: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(buffer, CHAR(STRING_ELT(ans, 0)), buflen); data/r-cran-rcurl-1.98-1.2/src/curl.c:991: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). len = strlen(tmp); data/r-cran-rcurl-1.98-1.2/src/curl_base64.c:174: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). insize = strlen(indata); data/r-cran-rcurl-1.98-1.2/src/curl_base64.c:226: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). return strlen(base64data); /* return the length of the new data */ data/r-cran-rcurl-1.98-1.2/src/json.c:134:7: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy( unicode_buf, s + i + 1, 5 ); data/r-cran-rcurl-1.98-1.2/src/json.c:173: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). num = 4 * strlen(CHAR(STRING_ELT(str, i))); data/r-cran-rcurl-1.98-1.2/src/json.c:184: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). mapString(tmp, (int)strlen(tmp), buf, ANALYSIS SUMMARY: Hits = 33 Lines analyzed = 4033 in approximately 0.13 seconds (30783 lines/second) Physical Source Lines of Code (SLOC) = 3073 Hits@level = [0] 192 [1] 12 [2] 21 [3] 0 [4] 0 [5] 0 Hits@level+ = [0+] 225 [1+] 33 [2+] 21 [3+] 0 [4+] 0 [5+] 0 Hits/KSLOC@level+ = [0+] 73.2184 [1+] 10.7387 [2+] 6.83371 [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.