The following issues were found
docs/examples/multithread.c
1 issues
Line: 42
Column: 7
CWE codes:
119
120
Suggestion:
Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length
https://curl.se/libcurl/c/threadsafe.html
*/
const char * const urls[NUMT]= {
"https://curl.se/",
"ftp://cool.haxx.se/",
"https://www.cag.se/",
"www.haxx.se"
};
Reported by FlawFinder.
tests/libtest/lib591.c
1 issues
Line: 48
Column: 12
CWE codes:
362
start_test_timing();
upload = fopen(libtest_arg3, "rb");
if(!upload) {
fprintf(stderr, "fopen() failed with error: %d (%s)\n",
errno, strerror(errno));
fprintf(stderr, "Error opening file: (%s)\n", libtest_arg3);
return TEST_ERR_FOPEN;
Reported by FlawFinder.
tests/libtest/lib599.c
1 issues
Line: 83
Column: 11
CWE codes:
362
FILE *moo;
res = curl_easy_getinfo(curl, CURLINFO_CONTENT_LENGTH_DOWNLOAD,
&content_length);
moo = fopen(libtest_arg2, "wb");
if(moo) {
fprintf(moo, "CL %.0f\n", content_length);
fclose(moo);
}
}
Reported by FlawFinder.
tests/unit/unit1620.c
1 issues
Line: 72
Column: 37
CWE codes:
126
fail_unless(rc == CURLE_OK, "Curl_init_do() failed");
rc = Curl_parse_login_details(
hostname, strlen(hostname), NULL, NULL, NULL);
fail_unless(rc == CURLE_OK,
"Curl_parse_login_details() failed");
Curl_freeset(empty);
for(i = (enum dupstring)0; i < STRING_LAST; i++) {
Reported by FlawFinder.
tests/libtest/lib651.c
1 issues
Line: 26
Column: 8
CWE codes:
119
120
Suggestion:
Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length
#include "memdebug.h"
static char buffer[17000]; /* more than 16K */
int test(char *URL)
{
CURL *curl;
CURLcode res = CURLE_OK;
Reported by FlawFinder.
tests/libtest/lib652.c
1 issues
Line: 26
Column: 8
CWE codes:
119
120
Suggestion:
Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length
#include "memdebug.h"
static char buffer[17000]; /* more than 16K */
int test(char *URL)
{
CURL *curl = NULL;
CURLcode res = CURLE_OK;
Reported by FlawFinder.
tests/libtest/lib654.c
1 issues
Line: 102
Column: 32
CWE codes:
126
/* Prepare the callback structure. */
pooh.readptr = data;
pooh.sizeleft = (curl_off_t) strlen(data);
pooh.freecount = 0;
/* Build the mime tree. */
mime = curl_mime_init(easy);
part = curl_mime_addpart(mime);
Reported by FlawFinder.
tests/libtest/lib666.c
1 issues
Line: 26
Column: 8
CWE codes:
119
120
Suggestion:
Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length
#include "memdebug.h"
static char buffer[17000]; /* more than 16K */
int test(char *URL)
{
CURL *curl = NULL;
CURLcode res = CURLE_OK;
Reported by FlawFinder.
tests/libtest/lib667.c
1 issues
Line: 92
Column: 32
CWE codes:
126
/* Prepare the callback structure. */
pooh.readptr = data;
pooh.sizeleft = (curl_off_t) strlen(data);
/* Build the mime tree. */
mime = curl_mime_init(easy);
part = curl_mime_addpart(mime);
curl_mime_name(part, "field");
Reported by FlawFinder.
tests/libtest/lib677.c
1 issues
Line: 29
Column: 8
CWE codes:
119
120
Suggestion:
Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length
#include "memdebug.h"
static const char cmd[] = "A1 IDLE\r\n";
static char buf[1024];
int test(char *URL)
{
CURLM *mcurl;
CURL *curl = NULL;
Reported by FlawFinder.