cvs: php4 /main rfc1867.c

From: Date: Wed, 05 Jun 2002 11:28:34 +0000
Subject: cvs: php4 /main rfc1867.c
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-12230@lists.php.net to get a copy of this message
sesser Wed Jun 5 07:28:34 2002 EDT Modified files: /php4/main rfc1867.c Log: fixing some crashbugs that can be triggered with bogus uploads. Index: php4/main/rfc1867.c diff -u php4/main/rfc1867.c:1.100 php4/main/rfc1867.c:1.101 --- php4/main/rfc1867.c:1.100 Fri May 31 05:05:39 2002 +++ php4/main/rfc1867.c Wed Jun 5 07:28:33 2002 @@ -16,7 +16,7 @@ | Jani Taskinen <sniper@php.net> | +----------------------------------------------------------------------+ */ -/* $Id: rfc1867.c,v 1.100 2002/05/31 09:05:39 derick Exp $ */ +/* $Id: rfc1867.c,v 1.101 2002/06/05 11:28:33 sesser Exp $ */ /* * This product includes software developed by the Apache Group @@ -354,6 +354,8 @@ entry.value[cur_len + prev_len] = '\0'; entry.key = estrdup(prev_entry.key); + } else { + continue; } zend_llist_add_element(header, &entry); @@ -706,15 +708,21 @@ /* If file_uploads=off, skip the file part */ if (!PG(file_uploads)) { - efree(filename); - if (param) efree(param); + if (filename) { + efree(filename); + } + 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); + if (filename) { + efree(filename); + } SAFE_RETURN; } @@ -824,7 +832,7 @@ s = NULL; /* Possible Content-Type: */ - if (!(cd = php_mime_get_hdr_value(header, "Content-Type")) || filename == "") { + if (cancel_upload || !(cd = php_mime_get_hdr_value(header, "Content-Type"))) { cd = ""; } else { /* fix for Opera 6.01 */

« previous php.cvs (#12230) next »