]> granicus.if.org Git - curl/commitdiff
formadd: CURLFORM_FILECONTENT wrongly rejected some option combos
authorDaniel Stenberg <daniel@haxx.se>
Tue, 23 Jul 2013 20:10:44 +0000 (22:10 +0200)
committerDaniel Stenberg <daniel@haxx.se>
Fri, 26 Jul 2013 21:45:01 +0000 (23:45 +0200)
The code for CURLFORM_FILECONTENT had its check for duplicate options
wrong so that it would reject CURLFORM_PTRNAME if used in combination
with it (but not CURLFORM_COPYNAME)! The flags field used for this
purpose cannot be interpreted that broadly.

Bug: http://curl.haxx.se/mail/lib-2013-07/0258.html
Reported-by: Byrial Jensen
lib/formdata.c

index decb84d9f453807e6f02dcf01a3ca5d6d869b929..1984a97123095aa3ef48093bd92ee2c960c5b989 100644 (file)
@@ -426,7 +426,7 @@ CURLFORMcode FormAdd(struct curl_httppost **httppost,
 
       /* Get contents from a given file name */
     case CURLFORM_FILECONTENT:
-      if(current_form->flags != 0)
+      if(current_form->flags & (HTTPPOST_PTRCONTENTS|HTTPPOST_READFILE))
         return_value = CURL_FORMADD_OPTION_TWICE;
       else {
         const char *filename = array_state?