From: Zeev Suraski Date: Sat, 11 May 2002 11:58:52 +0000 (+0000) Subject: MFH - avoid choking on 0 byte files X-Git-Tag: php-4.2.1~12 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=64595cc95953964a8c634715c8d4f6428a9a03be;p=php MFH - avoid choking on 0 byte files --- diff --git a/main/rfc1867.c b/main/rfc1867.c index 84c6078e38..6fad7eb3af 100644 --- a/main/rfc1867.c +++ b/main/rfc1867.c @@ -33,6 +33,8 @@ #include "rfc1867.h" +#undef DEBUG_FILE_UPLOAD + #define SAFE_RETURN { \ if (lbuf) efree(lbuf); \ if (abuf) efree(abuf); \ @@ -752,19 +754,19 @@ SAPI_API SAPI_POST_HANDLER_FUNC(rfc1867_post_handler) } fclose(fp); +#ifdef DEBUG_FILE_UPLOAD if(strlen(filename) > 0 && total_bytes == 0) { sapi_module.sapi_error(E_WARNING, "Uploaded file size 0 - file [%s=%s] not saved", param, filename); cancel_upload = UPLOAD_ERROR_E; } - - if (cancel_upload || total_bytes == 0) { +#endif + if (cancel_upload) { if (temp_filename) { unlink(temp_filename); efree(temp_filename); } temp_filename=""; - } else { zend_hash_add(SG(rfc1867_uploaded_files), temp_filename, strlen(temp_filename) + 1, &temp_filename, sizeof(char *), NULL); }