aboutsummaryrefslogtreecommitdiff
path: root/lib/formdata.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/formdata.c')
-rw-r--r--lib/formdata.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/lib/formdata.c b/lib/formdata.c
index 50a37e0e7..57ec6ad25 100644
--- a/lib/formdata.c
+++ b/lib/formdata.c
@@ -728,14 +728,10 @@ int curl_formget(struct curl_httppost *form, void *arg,
if(!nread)
break;
- switch(nread) {
- default:
- if(append(arg, buffer, nread) != nread)
- result = CURLE_READ_ERROR;
- break;
- case CURL_READFUNC_ABORT:
- case CURL_READFUNC_PAUSE:
- break;
+ if(nread > sizeof(buffer) || append(arg, buffer, nread) != nread) {
+ result = CURLE_READ_ERROR;
+ if(nread == CURL_READFUNC_ABORT)
+ result = CURLE_ABORTED_BY_CALLBACK;
}
}