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-data.table-1.13.2+dfsg/src/openmp-utils.c Examining data/r-cran-data.table-1.13.2+dfsg/src/freadR.h Examining data/r-cran-data.table-1.13.2+dfsg/src/freadR.c Examining data/r-cran-data.table-1.13.2+dfsg/src/myomp.h Examining data/r-cran-data.table-1.13.2+dfsg/src/rbindlist.c Examining data/r-cran-data.table-1.13.2+dfsg/src/data.table.h Examining data/r-cran-data.table-1.13.2+dfsg/src/inrange.c Examining data/r-cran-data.table-1.13.2+dfsg/src/uniqlist.c Examining data/r-cran-data.table-1.13.2+dfsg/src/types.c Examining data/r-cran-data.table-1.13.2+dfsg/src/dogroups.c Examining data/r-cran-data.table-1.13.2+dfsg/src/gsumm.c Examining data/r-cran-data.table-1.13.2+dfsg/src/fwriteLookups.h Examining data/r-cran-data.table-1.13.2+dfsg/src/vecseq.c Examining data/r-cran-data.table-1.13.2+dfsg/src/freadLookups.h Examining data/r-cran-data.table-1.13.2+dfsg/src/subset.c Examining data/r-cran-data.table-1.13.2+dfsg/src/init.c Examining data/r-cran-data.table-1.13.2+dfsg/src/types.h Examining data/r-cran-data.table-1.13.2+dfsg/src/utils.c Examining data/r-cran-data.table-1.13.2+dfsg/src/forder.c Examining data/r-cran-data.table-1.13.2+dfsg/src/snprintf.c Examining data/r-cran-data.table-1.13.2+dfsg/src/assign.c Examining data/r-cran-data.table-1.13.2+dfsg/src/fwrite.c Examining data/r-cran-data.table-1.13.2+dfsg/src/shift.c Examining data/r-cran-data.table-1.13.2+dfsg/src/fread.h Examining data/r-cran-data.table-1.13.2+dfsg/src/po.h Examining data/r-cran-data.table-1.13.2+dfsg/src/reorder.c Examining data/r-cran-data.table-1.13.2+dfsg/src/chmatch.c Examining data/r-cran-data.table-1.13.2+dfsg/src/wrappers.c Examining data/r-cran-data.table-1.13.2+dfsg/src/nafill.c Examining data/r-cran-data.table-1.13.2+dfsg/src/ijoin.c Examining data/r-cran-data.table-1.13.2+dfsg/src/nqrecreateindices.c Examining data/r-cran-data.table-1.13.2+dfsg/src/fread.c Examining data/r-cran-data.table-1.13.2+dfsg/src/fastmean.c Examining data/r-cran-data.table-1.13.2+dfsg/src/fcast.c Examining data/r-cran-data.table-1.13.2+dfsg/src/dt_stdio.h Examining data/r-cran-data.table-1.13.2+dfsg/src/froll.c Examining data/r-cran-data.table-1.13.2+dfsg/src/bmerge.c Examining data/r-cran-data.table-1.13.2+dfsg/src/between.c Examining data/r-cran-data.table-1.13.2+dfsg/src/frank.c Examining data/r-cran-data.table-1.13.2+dfsg/src/coalesce.c Examining data/r-cran-data.table-1.13.2+dfsg/src/frolladaptive.c Examining data/r-cran-data.table-1.13.2+dfsg/src/fifelse.c Examining data/r-cran-data.table-1.13.2+dfsg/src/fwriteR.c Examining data/r-cran-data.table-1.13.2+dfsg/src/transpose.c Examining data/r-cran-data.table-1.13.2+dfsg/src/fwrite.h Examining data/r-cran-data.table-1.13.2+dfsg/src/cj.c Examining data/r-cran-data.table-1.13.2+dfsg/src/fsort.c Examining data/r-cran-data.table-1.13.2+dfsg/src/quickselect.c Examining data/r-cran-data.table-1.13.2+dfsg/src/fmelt.c Examining data/r-cran-data.table-1.13.2+dfsg/src/frollR.c Examining data/r-cran-data.table-1.13.2+dfsg/inst/include/datatableAPI.h FINAL RESULTS: data/r-cran-data.table-1.13.2+dfsg/src/assign.c:594:9: [4] (buffer) strcat: Does not check for buffer overflows when concatenating to destination [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or snprintf (warning: strncat is easily misused). strcat(s5, tc2); data/r-cran-data.table-1.13.2+dfsg/src/assign.c:853:15: [4] (format) snprintf: 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. int n = snprintf(memrecycle_message, MSGSIZE, \ data/r-cran-data.table-1.13.2+dfsg/src/data.table.h:17:11: [4] (format) snprintf: 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. # define snprintf dt_win_snprintf // see our snprintf.c; tried and failed to link to _sprintf_p on Windows data/r-cran-data.table-1.13.2+dfsg/src/data.table.h:19:8: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. #ifdef sprintf data/r-cran-data.table-1.13.2+dfsg/src/data.table.h:20:8: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. #undef sprintf data/r-cran-data.table-1.13.2+dfsg/src/data.table.h:22:9: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. #define sprintf USE_SNPRINTF_NOT_SPRINTF // prevent use of sprintf in data.table source; force us to use n always data/r-cran-data.table-1.13.2+dfsg/src/forder.c:59:23: [4] (format) snprintf: 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. #define STOP(...) do {snprintf(msg, 1000, __VA_ARGS__); cleanup(); error(msg);} while(0) // http://gcc.gnu.org/onlinedocs/cpp/Swallowing-the-Semicolon.html#Swallowing-the-Semicolon data/r-cran-data.table-1.13.2+dfsg/src/fread.c:2378:21: [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(typeBumpMsg+typeBumpMsgSize, temp); data/r-cran-data.table-1.13.2+dfsg/src/freadR.c:697:3: [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. vsnprintf(msg, 2000, format, args); data/r-cran-data.table-1.13.2+dfsg/src/fwrite.c:690:12: [4] (race) access: This usually indicates a security flaw. If an attacker can change anything along the path between the call to access() and the file's actual use (e.g., by moving files), the attacker can exploit the race condition (CWE-362/CWE-367!). Set up the correct permissions (e.g., using setuid()) and try to open the file directly. STOP(access( args.filename, F_OK ) != -1 ? data/r-cran-data.table-1.13.2+dfsg/src/rbindlist.c:382:19: [4] (format) snprintf: 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. snprintf(warnStr, 1000, // not direct warning as we're inside tl region data/r-cran-data.table-1.13.2+dfsg/src/snprintf.c:22:8: [4] (format) snprintf: 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. #undef snprintf // on Windows, just in this file, we do want to use the C library's snprintf data/r-cran-data.table-1.13.2+dfsg/src/snprintf.c:86:15: [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. int ans = vsnprintf(dest, n, fmt, ap); data/r-cran-data.table-1.13.2+dfsg/src/snprintf.c:111:5: [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(ch2, delim); // includes '\0' data/r-cran-data.table-1.13.2+dfsg/src/snprintf.c:123:13: [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. int res = vsnprintf(buff, n, spec, ap); // C library does all the (non-positional) hard work here data/r-cran-data.table-1.13.2+dfsg/src/snprintf.c:139:18: [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. int newres = vsnprintf(buff, res+1, spec, ap); // try again; test 9 data/r-cran-data.table-1.13.2+dfsg/src/openmp-utils.c:14:21: [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. const char *val = getenv(name); data/r-cran-data.table-1.13.2+dfsg/src/openmp-utils.c:73:21: [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. const char *ans = getenv(name); data/r-cran-data.table-1.13.2+dfsg/src/assign.c:581: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(s4, c1, strlen(c1)); data/r-cran-data.table-1.13.2+dfsg/src/assign.c:583:7: [2] (buffer) strcat: Does not check for buffer overflows when concatenating to destination [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or snprintf (warning: strncat is easily misused). Risk is low because the source is a constant string. strcat(s4, "__"); // add trailing '__' to newKey so we can search for pattern '__colName__' also at the end of the index. data/r-cran-data.table-1.13.2+dfsg/src/assign.c:595:9: [2] (buffer) strcat: Does not check for buffer overflows when concatenating to destination [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or snprintf (warning: strncat is easily misused). Risk is low because the source is a constant string. strcat(s5, "__"); data/r-cran-data.table-1.13.2+dfsg/src/assign.c:674: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 memrecycle_message[MSGSIZE+1]; // returned to rbindlist so it can prefix with which one of the list of data.table-like objects data/r-cran-data.table-1.13.2+dfsg/src/assign.c:943:21: [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(td, RAW(source), slen*sizeof(Rbyte)); break; data/r-cran-data.table-1.13.2+dfsg/src/assign.c:960:21: [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(td, LOGICAL(source), slen*sizeof(Rboolean)); break; data/r-cran-data.table-1.13.2+dfsg/src/assign.c:977:21: [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(td, INTEGER(source), slen*sizeof(int)); break; data/r-cran-data.table-1.13.2+dfsg/src/assign.c:996:21: [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(td, (int64_t *)REAL(source), slen*sizeof(int64_t)); break; data/r-cran-data.table-1.13.2+dfsg/src/assign.c:1010:21: [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(td, (double *)REAL(source), slen*sizeof(double)); break; data/r-cran-data.table-1.13.2+dfsg/src/assign.c:1030:21: [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(td, COMPLEX(source), slen*sizeof(Rcomplex)); break; data/r-cran-data.table-1.13.2+dfsg/src/between.c:70:71: [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). ansp[i] = elem==NA_INTEGER ? NA_LOGICAL : (l==NA_INTEGER || l+open<=elem) && (u==NA_INTEGER || elem<=u-open); data/r-cran-data.table-1.13.2+dfsg/src/between.c:70:112: [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). ansp[i] = elem==NA_INTEGER ? NA_LOGICAL : (l==NA_INTEGER || l+open<=elem) && (u==NA_INTEGER || elem<=u-open); data/r-cran-data.table-1.13.2+dfsg/src/between.c:79:36: [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). ansp[i] = (lok && uok) ? l+open<=elem && elem<=u-open : ((uok && elem>u-open) || (lok && elem<l+open)) ? FALSE : NA_LOGICAL; data/r-cran-data.table-1.13.2+dfsg/src/between.c:79:58: [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). ansp[i] = (lok && uok) ? l+open<=elem && elem<=u-open : ((uok && elem>u-open) || (lok && elem<l+open)) ? FALSE : NA_LOGICAL; data/r-cran-data.table-1.13.2+dfsg/src/between.c:79:81: [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). ansp[i] = (lok && uok) ? l+open<=elem && elem<=u-open : ((uok && elem>u-open) || (lok && elem<l+open)) ? FALSE : NA_LOGICAL; data/r-cran-data.table-1.13.2+dfsg/src/between.c:79:105: [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). ansp[i] = (lok && uok) ? l+open<=elem && elem<=u-open : ((uok && elem>u-open) || (lok && elem<l+open)) ? FALSE : NA_LOGICAL; data/r-cran-data.table-1.13.2+dfsg/src/between.c:101:77: [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). ansp[i] = elem==NA_INTEGER64 ? NA_LOGICAL : (l==NA_INTEGER64 || l+open<=elem) && (u==NA_INTEGER64 || elem<=u-open); data/r-cran-data.table-1.13.2+dfsg/src/between.c:101:120: [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). ansp[i] = elem==NA_INTEGER64 ? NA_LOGICAL : (l==NA_INTEGER64 || l+open<=elem) && (u==NA_INTEGER64 || elem<=u-open); data/r-cran-data.table-1.13.2+dfsg/src/between.c:109:38: [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). ansp[i] = (lok && uok) ? l+open<=elem && elem<=u-open : ((uok && elem>u-open) || (lok && elem<l+open)) ? FALSE : NA_LOGICAL; data/r-cran-data.table-1.13.2+dfsg/src/between.c:109:60: [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). ansp[i] = (lok && uok) ? l+open<=elem && elem<=u-open : ((uok && elem>u-open) || (lok && elem<l+open)) ? FALSE : NA_LOGICAL; data/r-cran-data.table-1.13.2+dfsg/src/between.c:109:83: [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). ansp[i] = (lok && uok) ? l+open<=elem && elem<=u-open : ((uok && elem>u-open) || (lok && elem<l+open)) ? FALSE : NA_LOGICAL; data/r-cran-data.table-1.13.2+dfsg/src/between.c:109:107: [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). ansp[i] = (lok && uok) ? l+open<=elem && elem<=u-open : ((uok && elem>u-open) || (lok && elem<l+open)) ? FALSE : NA_LOGICAL; data/r-cran-data.table-1.13.2+dfsg/src/between.c:124:11: [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). if (open) { data/r-cran-data.table-1.13.2+dfsg/src/between.c:166:68: [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). #define LCMP (strcmp(CHAR(ENC2UTF8(l)),CHAR(ENC2UTF8(elem)))<=-open) data/r-cran-data.table-1.13.2+dfsg/src/between.c:167:68: [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). #define UCMP (strcmp(CHAR(ENC2UTF8(elem)),CHAR(ENC2UTF8(u)))<=-open) data/r-cran-data.table-1.13.2+dfsg/src/bmerge.c:176:5: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(INTEGER(retFirstArg), retFirst, sizeof(int)*ctr); data/r-cran-data.table-1.13.2+dfsg/src/bmerge.c:177: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(INTEGER(retLengthArg), retLength, sizeof(int)*ctr); data/r-cran-data.table-1.13.2+dfsg/src/bmerge.c:178: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(INTEGER(retIndexArg), retIndex, sizeof(int)*ctr); data/r-cran-data.table-1.13.2+dfsg/src/cj.c:33: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(targetP + i*blocklen, targetP, blocklen*sizeof(int)); data/r-cran-data.table-1.13.2+dfsg/src/cj.c:47: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(targetP + i*blocklen, targetP, blocklen*sizeof(double)); data/r-cran-data.table-1.13.2+dfsg/src/cj.c:61: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(targetP + i*blocklen, targetP, blocklen*sizeof(Rcomplex)); data/r-cran-data.table-1.13.2+dfsg/src/dogroups.c:481:17: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. case RAWSXP: memcpy(RAW(newx), RAW(x), len*SIZEOF(x)); break; data/r-cran-data.table-1.13.2+dfsg/src/dogroups.c:482:17: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. case LGLSXP: memcpy(LOGICAL(newx), LOGICAL(x), len*SIZEOF(x)); break; data/r-cran-data.table-1.13.2+dfsg/src/dogroups.c:483:17: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. case INTSXP: memcpy(INTEGER(newx), INTEGER(x), len*SIZEOF(x)); break; data/r-cran-data.table-1.13.2+dfsg/src/dogroups.c:484:17: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. case REALSXP: memcpy(REAL(newx), REAL(x), len*SIZEOF(x)); break; data/r-cran-data.table-1.13.2+dfsg/src/dogroups.c:485:17: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. case CPLXSXP: memcpy(COMPLEX(newx), COMPLEX(x), len*SIZEOF(x)); break; data/r-cran-data.table-1.13.2+dfsg/src/fmelt.c:32:10: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. if (n) memcpy(INTEGER(ans), buf, sizeof(int) * n); // sizeof is of type size_t - no integer overflow issues data/r-cran-data.table-1.13.2+dfsg/src/fmelt.c:51:10: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. if (n) memcpy(INTEGER(ans), buf, sizeof(int) * n); data/r-cran-data.table-1.13.2+dfsg/src/fmelt.c:68:10: [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 ans[1024]; // so only one call to concat() per calling warning/error data/r-cran-data.table-1.13.2+dfsg/src/fmelt.c:488:11: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(dtarget + j*data->nrow, dthiscol, data->nrow*size); data/r-cran-data.table-1.13.2+dfsg/src/fmelt.c:500:11: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(itarget + j*data->nrow, ithiscol, data->nrow*size); data/r-cran-data.table-1.13.2+dfsg/src/fmelt.c:542:9: [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 buff[20]; data/r-cran-data.table-1.13.2+dfsg/src/fmelt.c:582:9: [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 buff[20]; data/r-cran-data.table-1.13.2+dfsg/src/fmelt.c:626:11: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(dtarget + j*data->nrow, dthiscol, data->nrow*size); data/r-cran-data.table-1.13.2+dfsg/src/fmelt.c:645:11: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(itarget + j*data->nrow, ithiscol, data->nrow*size); data/r-cran-data.table-1.13.2+dfsg/src/forder.c:58: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 msg[1001]; data/r-cran-data.table-1.13.2+dfsg/src/forder.c:109: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(gs_thread[me]+gs_thread_n[me], x, n*sizeof(int)); data/r-cran-data.table-1.13.2+dfsg/src/forder.c:123: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(gs+gs_n, gs_thread[me], n*sizeof(int)); data/r-cran-data.table-1.13.2+dfsg/src/forder.c:259: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(xsub, cradix_xtmp, n*sizeof(SEXP)); data/r-cran-data.table-1.13.2+dfsg/src/forder.c:332: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(ustr3, STRING_PTR(ustr2), ustr_n*sizeof(SEXP)); data/r-cran-data.table-1.13.2+dfsg/src/forder.c:914: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((int *restrict)(anso+from), TMP, my_n*sizeof(int)); data/r-cran-data.table-1.13.2+dfsg/src/forder.c:918: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((uint8_t *restrict)(key[r]+from), (uint8_t *)TMP, my_n); data/r-cran-data.table-1.13.2+dfsg/src/forder.c:1005: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(anso+from, my_TMP, my_n*sizeof(int)); data/r-cran-data.table-1.13.2+dfsg/src/forder.c:1013:11: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(my_starts, my_starts_copy, 256*sizeof(uint16_t)); // restore starting offsets data/r-cran-data.table-1.13.2+dfsg/src/forder.c:1017:11: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(key[r]+from, my_TMP, my_n); data/r-cran-data.table-1.13.2+dfsg/src/forder.c:1098: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(anso+my_from, my_otmp, my_n*sizeof(int)); data/r-cran-data.table-1.13.2+dfsg/src/forder.c:1099:37: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. for (int r=0; r<n_rem; r++) memcpy(key[radix+1+r]+my_from, my_ktmp+r*my_n, my_n*sizeof(uint8_t)); data/r-cran-data.table-1.13.2+dfsg/src/forder.c:1173: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(TMP+my_starts[*byte], osub, len*sizeof(int)); data/r-cran-data.table-1.13.2+dfsg/src/forder.c:1177: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(anso+from, TMP, my_n*sizeof(int)); data/r-cran-data.table-1.13.2+dfsg/src/forder.c:1189:11: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy((uint8_t *)TMP + my_starts[*byte], ksub, len); data/r-cran-data.table-1.13.2+dfsg/src/forder.c:1193: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(key[radix+1+r]+from, (uint8_t *)TMP, my_n); data/r-cran-data.table-1.13.2+dfsg/src/forder.c:1407:3: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buffer[69]; data/r-cran-data.table-1.13.2+dfsg/src/fread.c:69: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. const char typeName[NUMTYPE][10] = {"drop", "bool8", "bool8", "bool8", "bool8", "int32", "int64", "float64", "float64", "float64", "int32", "float64", "string"}; data/r-cran-data.table-1.13.2+dfsg/src/fread.c:192:10: [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 buf[1002]; data/r-cran-data.table-1.13.2+dfsg/src/fread.c:211:10: [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 str[101]; data/r-cran-data.table-1.13.2+dfsg/src/fread.c:403:10: [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 suffixes[NSUFFIXES] = {'T', 'G', 'M', 'K'}; data/r-cran-data.table-1.13.2+dfsg/src/fread.c:404:10: [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 output[BUFFSIZE]; data/r-cran-data.table-1.13.2+dfsg/src/fread.c:436: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(mmp_copy, mmp, fileSize); data/r-cran-data.table-1.13.2+dfsg/src/fread.c:1263: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(&NA_FLOAT64, &ui64, 8); data/r-cran-data.table-1.13.2+dfsg/src/fread.c:1356:16: [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). int fd = open(fnam, O_RDONLY); data/r-cran-data.table-1.13.2+dfsg/src/fread.c:1863: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(type, tmpType, (size_t)ncol); data/r-cran-data.table-1.13.2+dfsg/src/fread.c:1870: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(type, tmpType, (size_t)ncol); data/r-cran-data.table-1.13.2+dfsg/src/fread.c:2048: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(tmpType, type, (size_t)ncol) ; data/r-cran-data.table-1.13.2+dfsg/src/fread.c:2107: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 internalErr[internalErrSize+1]=""; // must be compile time size: the message is generated and we can't free before STOP data/r-cran-data.table-1.13.2+dfsg/src/fread.c:2274:29: [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. if (thisSize) ((char **) targets)[thisSize] += thisSize; // 'if' for when rereading to avoid undefined NULL+0 data/r-cran-data.table-1.13.2+dfsg/src/fread.c:2287:29: [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. if (thisSize) ((char **) targets)[thisSize] += thisSize; data/r-cran-data.table-1.13.2+dfsg/src/fread.c:2369:19: [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[1001]; data/r-cran-data.table-1.13.2+dfsg/src/fread.h:34: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. extern const char typeName[NUMTYPE][10]; data/r-cran-data.table-1.13.2+dfsg/src/fread.h:147: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 _padding[1]; data/r-cran-data.table-1.13.2+dfsg/src/freadR.c:28: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 typeRName[NUT][10]={"NULL", "logical", "logical", "logical", "logical", "integer", "integer64", "double", "double", "double", "IDate", "POSIXct", "character", "numeric", "CLASS" }; data/r-cran-data.table-1.13.2+dfsg/src/freadR.c:232: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. static char buff[51]; data/r-cran-data.table-1.13.2+dfsg/src/freadR.c:262: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 buff[12]; data/r-cran-data.table-1.13.2+dfsg/src/freadR.c:696:3: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char msg[2000]; data/r-cran-data.table-1.13.2+dfsg/src/froll.c:421: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(w, x, k*sizeof(double)); data/r-cran-data.table-1.13.2+dfsg/src/froll.c:442: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(w, x+(i-k+1), k*sizeof(double)); data/r-cran-data.table-1.13.2+dfsg/src/froll.c:447: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(w, x+(i-k+1), k*sizeof(double)); data/r-cran-data.table-1.13.2+dfsg/src/fsort.c:66: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(in, working, n*sizeof(double)); data/r-cran-data.table-1.13.2+dfsg/src/fwrite.c:684:9: [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). f = open(args.filename, O_WRONLY | O_CREAT | (args.append ? O_APPEND : O_TRUNC), 0666); data/r-cran-data.table-1.13.2+dfsg/src/fwrite.c:716: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(ch, args.yaml, yamlLen); data/r-cran-data.table-1.13.2+dfsg/src/fwrite.c:830: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 failed_msg[1001] = ""; // to hold zlib's msg; copied out of zlib in ordered section just in case the msg is allocated within zlib data/r-cran-data.table-1.13.2+dfsg/src/gsumm.c:186: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(my_tmpcounts, my_counts, highSize*sizeof(int)); data/r-cran-data.table-1.13.2+dfsg/src/gsumm.c:223: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(my_tmpcounts, counts + b*highSize, highSize*sizeof(int)); // original cumulated // already cumulated for this batch data/r-cran-data.table-1.13.2+dfsg/src/gsumm.c:252: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(my_tmpcounts, counts + b*highSize, highSize*sizeof(int)); data/r-cran-data.table-1.13.2+dfsg/src/gsumm.c:279: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(my_tmpcounts, counts + b*highSize, highSize*sizeof(int)); data/r-cran-data.table-1.13.2+dfsg/src/gsumm.c:308: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(my_tmpcounts, counts + b*highSize, highSize*sizeof(int)); data/r-cran-data.table-1.13.2+dfsg/src/rbindlist.c:184: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(colMap, colMapRaw, LENGTH(l)*ncol*sizeof(int)); data/r-cran-data.table-1.13.2+dfsg/src/rbindlist.c:195: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 buff[1001] = ""; data/r-cran-data.table-1.13.2+dfsg/src/rbindlist.c:323:30: [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. if (!foundName) { static char buff[12]; snprintf(buff,12,"V%d",j+1), SET_STRING_ELT(ansNames, idcol+j, mkChar(buff)); foundName=buff; } data/r-cran-data.table-1.13.2+dfsg/src/rbindlist.c:347: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 warnStr[1000] = ""; data/r-cran-data.table-1.13.2+dfsg/src/rbindlist.c:477:17: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(targetd+ansloc, id, thisnrow*SIZEOF(thisCol)); data/r-cran-data.table-1.13.2+dfsg/src/reorder.c:92: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(((char *)DATAPTR_RO(v)) + size*start, TMP, size*nmid); data/r-cran-data.table-1.13.2+dfsg/src/snprintf.c:29:9: [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 *strp[99]={NULL}; data/r-cran-data.table-1.13.2+dfsg/src/snprintf.c:58:17: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). int pos = atoi(ch+1); data/r-cran-data.table-1.13.2+dfsg/src/snprintf.c:91:9: [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 delim[NDELIM+1] = "\x7f\x7f"; // tokenize temporary using 2 DELs data/r-cran-data.table-1.13.2+dfsg/src/snprintf.c:174:21: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). const int pos = atoi(ch+1); // valid position already checked above data/r-cran-data.table-1.13.2+dfsg/src/snprintf.c:189: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 buff[50]; data/r-cran-data.table-1.13.2+dfsg/src/types.h:14: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 message[4][ANS_MSG_SIZE]; // STDOUT: output, STDERR: message, warning, error data/r-cran-data.table-1.13.2+dfsg/src/uniqlist.c:141: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(INTEGER(ans), iidx, sizeof(int)*len); // sizeof is of type size_t - no integer overflow issues data/r-cran-data.table-1.13.2+dfsg/src/utils.c:258: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(RAW(ans), RAW(x), n*sizeof(Rbyte)); data/r-cran-data.table-1.13.2+dfsg/src/utils.c:261: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(LOGICAL(ans), LOGICAL(x), n*sizeof(Rboolean)); data/r-cran-data.table-1.13.2+dfsg/src/utils.c:264: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(INTEGER(ans), INTEGER(x), n*sizeof(int)); // covered by 10:1 after test 178 data/r-cran-data.table-1.13.2+dfsg/src/utils.c:267: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(REAL(ans), REAL(x), n*sizeof(double)); // covered by as.Date("2013-01-01")+seq(1,1000,by=10) after test 1075 data/r-cran-data.table-1.13.2+dfsg/src/utils.c:270: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(COMPLEX(ans), COMPLEX(x), n*sizeof(Rcomplex)); data/r-cran-data.table-1.13.2+dfsg/src/wrappers.c:77:3: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buffer[32]; data/r-cran-data.table-1.13.2+dfsg/src/assign.c:577:33: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). char *s4 = (char*) malloc(strlen(c1) + 3); data/r-cran-data.table-1.13.2+dfsg/src/assign.c:581: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). memcpy(s4, c1, strlen(c1)); data/r-cran-data.table-1.13.2+dfsg/src/assign.c:582:19: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). memset(s4 + strlen(c1), '\0', 1); data/r-cran-data.table-1.13.2+dfsg/src/assign.c:584: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). newKeyLength = strlen(c1); data/r-cran-data.table-1.13.2+dfsg/src/assign.c:587:35: [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 *s5 = (char*) malloc(strlen(tc2) + 5); //4 * '_' + \0 data/r-cran-data.table-1.13.2+dfsg/src/assign.c:613: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). } else if(newKeyLength < strlen(c1)) { data/r-cran-data.table-1.13.2+dfsg/src/fmelt.c:85:5: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(pos, CHAR(this), len); data/r-cran-data.table-1.13.2+dfsg/src/fread.c:209: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). int nLetters = strlen(typeLetter); data/r-cran-data.table-1.13.2+dfsg/src/fread.c:1283: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). size_t nchar = strlen(ch); data/r-cran-data.table-1.13.2+dfsg/src/fread.c:1348: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). fileSize = strlen(sof); data/r-cran-data.table-1.13.2+dfsg/src/fread.c:1605:21: [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). nseps = (int) strlen(seps); data/r-cran-data.table-1.13.2+dfsg/src/fread.c:2149:3: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). read: // we'll return here to reread any columns with out-of-sample type exceptions, or dirty jumps data/r-cran-data.table-1.13.2+dfsg/src/fread.c:2498:12: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). goto read; data/r-cran-data.table-1.13.2+dfsg/src/fread.c:2503:12: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). goto read; data/r-cran-data.table-1.13.2+dfsg/src/fread.c:2550:12: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). goto read; data/r-cran-data.table-1.13.2+dfsg/src/freadR.c:102:49: [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 (!isString(sepArg) || LENGTH(sepArg)!=1 || strlen(CHAR(STRING_ELT(sepArg,0)))>1) data/r-cran-data.table-1.13.2+dfsg/src/freadR.c:106: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). if (!(isString(decArg) && LENGTH(decArg)==1 && strlen(CHAR(STRING_ELT(decArg,0)))==1)) data/r-cran-data.table-1.13.2+dfsg/src/freadR.c:113:55: [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 (!isString(quoteArg) || LENGTH(quoteArg)!=1 || strlen(CHAR(STRING_ELT(quoteArg,0))) > 1) data/r-cran-data.table-1.13.2+dfsg/src/fwrite.c:616: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). int eolLen=strlen(args.eol), naLen=strlen(args.na); data/r-cran-data.table-1.13.2+dfsg/src/fwrite.c:616:38: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). int eolLen=strlen(args.eol), naLen=strlen(args.na); data/r-cran-data.table-1.13.2+dfsg/src/fwrite.c:698:17: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). int yamlLen = strlen(args.yaml); data/r-cran-data.table-1.13.2+dfsg/src/fwrite.c:895:37: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). if (mystream.msg!=NULL) strncpy(failed_msg, mystream.msg, 1000); // copy zlib's msg for safe use after deflateEnd just in case zlib allocated the message data/r-cran-data.table-1.13.2+dfsg/src/openmp-utils.c:16: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). size_t nchar = strlen(val); data/r-cran-data.table-1.13.2+dfsg/src/snprintf.c:109:5: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(ch2, strp[i], strl[i]); // write the reordered specifers without the n$ part data/r-cran-data.table-1.13.2+dfsg/src/snprintf.c:177:5: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(ch2, strp[pos-1], nWrite); data/r-cran-data.table-1.13.2+dfsg/src/snprintf.c:210:7: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (strlen(buff)!=39 || strcmp(buff, "long format string more than n==40 chop")) error("dt_win_snprintf test 7 failed: %s", buff); data/r-cran-data.table-1.13.2+dfsg/src/snprintf.c:213:7: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (strlen(buff)!=39 || strcmp(buff, "long format string more than n==40 chop")) error("dt_win_snprintf test 8 failed: %s", buff); data/r-cran-data.table-1.13.2+dfsg/src/snprintf.c:216:7: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (strlen(buff)!=9 || strcmp(buff, "442223355")) error("dt_win_snprintf test 9 failed: %s", buff); data/r-cran-data.table-1.13.2+dfsg/src/snprintf.c:220:7: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (strlen(buff)!=38 || strcmp(buff, "0 %l does not end with recognized t")) error("dt_win_snprintf test 11 failed: %s", buff); data/r-cran-data.table-1.13.2+dfsg/src/snprintf.c:223:7: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (strlen(buff)!=18 || strcmp(buff, "0 %l does not e")) error("dt_win_snprintf test 12 failed: %s", buff); ANALYSIS SUMMARY: Hits = 162 Lines analyzed = 21502 in approximately 0.79 seconds (27263 lines/second) Physical Source Lines of Code (SLOC) = 17846 Hits@level = [0] 82 [1] 30 [2] 114 [3] 2 [4] 16 [5] 0 Hits@level+ = [0+] 244 [1+] 162 [2+] 132 [3+] 18 [4+] 16 [5+] 0 Hits/KSLOC@level+ = [0+] 13.6725 [1+] 9.07766 [2+] 7.39662 [3+] 1.00863 [4+] 0.896559 [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.