mirror of
https://github.com/php/php-src.git
synced 2025-08-15 21:48:51 +02:00
Prevent crashing with some bogus POSTs.
This commit is contained in:
parent
750ca4295e
commit
bccfe80480
1 changed files with 8 additions and 1 deletions
|
@ -704,10 +704,17 @@ SAPI_API SAPI_POST_HANDLER_FUNC(rfc1867_post_handler)
|
|||
/* If file_uploads=off, skip the file part */
|
||||
if (!PG(file_uploads)) {
|
||||
efree(filename);
|
||||
efree(param);
|
||||
if (param) efree(param);
|
||||
continue;
|
||||
}
|
||||
|
||||
/* Return with an error if the posted data is garbled */
|
||||
if (!param) {
|
||||
sapi_module.sapi_error(E_WARNING, "File Upload Mime headers garbled");
|
||||
efree(filename);
|
||||
SAFE_RETURN;
|
||||
}
|
||||
|
||||
/* Handle file */
|
||||
fp = php_open_temporary_file(PG(upload_tmp_dir), "php", &temp_filename TSRMLS_CC);
|
||||
if (!fp) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue