Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stack overflow in libcurl when CURLOPT_WILDCARDMATCH is in use #6255

Closed
xnynx opened this issue Nov 27, 2020 · 0 comments
Closed

Stack overflow in libcurl when CURLOPT_WILDCARDMATCH is in use #6255

xnynx opened this issue Nov 27, 2020 · 0 comments
Labels
FTP Windows Windows-specific

Comments

@xnynx
Copy link

xnynx commented Nov 27, 2020

#include <curl/curl.h>

long ChunkBgnFunction(const struct curl_fileinfo *finfo, struct callback_data *, int)
{
	if (finfo->filetype == CURLFILETYPE_FILE)
		return CURL_CHUNK_BGN_FUNC_SKIP;

	return CURL_CHUNK_BGN_FUNC_OK;
}

void main()
{
	curl_global_init(CURL_GLOBAL_ALL);

	auto curl = curl_easy_init();

	curl_easy_setopt(curl, CURLOPT_USE_SSL, CURLUSESSL_TRY);
	curl_easy_setopt(curl, CURLOPT_SSL_VERIFYHOST, 2L);
	curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER, 0L);

	curl_easy_setopt(curl, CURLOPT_URL, "ftp://gdc.cddis.eosdis.nasa.gov/gnss/data/daily/2020/brdc/*");
	curl_easy_setopt(curl, CURLOPT_WILDCARDMATCH, 1L);
	curl_easy_setopt(curl, CURLOPT_NOBODY, 0L);

	curl_easy_setopt(curl, CURLOPT_CHUNK_BGN_FUNCTION, ChunkBgnFunction);

	const CURLcode code = curl_easy_perform(curl);

	curl_easy_cleanup(curl);

	curl_global_cleanup();
}

The reason is about 1700 files in the directory.

libcurl version: 7.73.0
compiler: VS2019 16.7.7

@bagder bagder added FTP Windows Windows-specific labels Nov 27, 2020
@bagder bagder closed this as completed in 69a358f Dec 7, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
FTP Windows Windows-specific
Development

No branches or pull requests

2 participants