aboutsummaryrefslogtreecommitdiff
path: root/lib/transfer.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/transfer.c')
-rw-r--r--lib/transfer.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/transfer.c b/lib/transfer.c
index 956a47996..1938a8a2c 100644
--- a/lib/transfer.c
+++ b/lib/transfer.c
@@ -578,6 +578,11 @@ CURLcode Curl_readwrite(struct connectdata *conn,
/* check for Content-Length: header lines to get size */
if (checkprefix("Content-Length:", k->p) &&
sscanf (k->p+15, " %ld", &k->contentlength)) {
+ if (data->set.max_filesize && k->contentlength >
+ data->set.max_filesize) {
+ failf(data, "Maximum file size exceeded");
+ return CURLE_FILESIZE_EXCEEDED;
+ }
conn->size = k->contentlength;
Curl_pgrsSetDownloadSize(data, k->contentlength);
}