diff options
Diffstat (limited to 'src/tool_cb_wrt.c')
-rw-r--r-- | src/tool_cb_wrt.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/tool_cb_wrt.c b/src/tool_cb_wrt.c index 3a2cd791a..1889080de 100644 --- a/src/tool_cb_wrt.c +++ b/src/tool_cb_wrt.c @@ -51,6 +51,13 @@ size_t tool_write_cb(void *buffer, size_t sz, size_t nmemb, void *userdata) */ const size_t err_rc = (sz * nmemb) ? 0 : 1; +#ifdef DEBUGBUILD + if(sz * nmemb > (size_t)CURL_MAX_WRITE_SIZE) { + warnf(config, "Data size exceeds single call write limit!\n"); + return err_rc; /* Failure */ + } +#endif + if(!out->stream) { out->bytes = 0; /* nothing written yet */ if(!out->filename) { |