summaryrefslogtreecommitdiff
path: root/lib/formdata.c
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2013-03-04 15:20:22 +0100
committerDaniel Stenberg <daniel@haxx.se>2013-03-04 15:52:10 +0100
commit26eaa8383001219e7cd14a153dff95ea9274be6e (patch)
tree7daa0f875dfbe39ea91214775cd56eeef4ebb87f /lib/formdata.c
parentfadf33c78ac7bdfc6790350de9a0dfc8bcdb030b (diff)
downloadcurl-26eaa8383001219e7cd14a153dff95ea9274be6e.tar.gz
AddFormData: prevent only directories from being posted
Commit f4cc54cb4746ae5a6d (shipped as part of the 7.29.0 release) was a bug fix that introduced a regression in that while trying to avoid allowing directory names, it also forbade "special" files like character devices and more. like "/dev/null" as was used by Oliver who reported this regression. Reported by: Oliver Gondža Bug: http://curl.haxx.se/mail/archive-2013-02/0040.html
Diffstat (limited to 'lib/formdata.c')
-rw-r--r--lib/formdata.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/formdata.c b/lib/formdata.c
index 308b33a85..49c5d2943 100644
--- a/lib/formdata.c
+++ b/lib/formdata.c
@@ -831,7 +831,7 @@ static CURLcode AddFormData(struct FormData **formp,
file */
if(!strequal("-", newform->line)) {
struct_stat file;
- if(!stat(newform->line, &file) && S_ISREG(file.st_mode))
+ if(!stat(newform->line, &file) && !S_ISDIR(file.st_mode))
*size += file.st_size;
else
return CURLE_BAD_FUNCTION_ARGUMENT;