mirror of
https://github.com/curl/curl.git
synced 2026-07-31 20:48:02 +03:00
AddFormData: prevent only directories from being posted
Commit f4cc54cb47 (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
This commit is contained in:
parent
fadf33c78a
commit
26eaa83830
1 changed files with 1 additions and 1 deletions
|
|
@ -831,7 +831,7 @@ static CURLcode AddFormData(struct FormData **formp,
|
||||||
file */
|
file */
|
||||||
if(!strequal("-", newform->line)) {
|
if(!strequal("-", newform->line)) {
|
||||||
struct_stat file;
|
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;
|
*size += file.st_size;
|
||||||
else
|
else
|
||||||
return CURLE_BAD_FUNCTION_ARGUMENT;
|
return CURLE_BAD_FUNCTION_ARGUMENT;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue