Maximum amount of data a header callback is supposed to get in
a single call from libcurl is limited by the lowest value of
CURL_MAX_WRITE_SIZE and CURL_MAX_HTTP_HEADER.
size_t failure = (size * nmemb) ? 0 : 1;
#ifdef DEBUGBUILD
- if(size * nmemb > (size_t)CURL_MAX_WRITE_SIZE) {
+ if((size * nmemb > (size_t)CURL_MAX_WRITE_SIZE) ||
+ (size * nmemb > (size_t)CURL_MAX_HTTP_HEADER)) {
warnf(outs->config, "Header data exceeds single call write limit!\n");
return failure;
}