cvs: php3 /functions mime.c

From: Date: Tue, 17 Oct 2000 01:30:59 +0000
Subject: cvs: php3 /functions mime.c
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-2081@lists.php.net to get a copy of this message
sas Mon Oct 16 18:30:59 2000 EDT Modified files: /php3/functions mime.c Log: Fix namespace protection. In state 2, we parse normal FORM fields (i.e. hidden and text fields). Here sbuf is not set at all, so strlen(NULL) causes a segfault. PR: #7198 Index: php3/functions/mime.c diff -u php3/functions/mime.c:1.63 php3/functions/mime.c:1.64 --- php3/functions/mime.c:1.63 Sat Sep 9 14:05:45 2000 +++ php3/functions/mime.c Mon Oct 16 18:30:59 2000 @@ -26,7 +26,7 @@ | Authors: Rasmus Lerdorf <rasmus@php.net> | +----------------------------------------------------------------------+ */ -/* $Id: mime.c,v 1.63 2000/09/09 21:05:45 zeev Exp $ */ +/* $Id: mime.c,v 1.64 2000/10/17 01:30:59 sas Exp $ */ #include <stdio.h> #include "php.h" #include "internal_functions.h" @@ -183,10 +183,7 @@ } *(loc - 4) = '\0'; - /* Check to make sure we are not overwriting special file upload variables */ - if(memcmp(namebuf,sbuf,strlen(sbuf))) { - _php3_parse_gpc_data(ptr,namebuf,http_post_vars); - } + _php3_parse_gpc_data(ptr,namebuf,http_post_vars); /* And a little kludge to pick out special MAX_FILE_SIZE */ itype = php3_check_ident_type(namebuf); @@ -237,11 +234,13 @@ php3_error(E_WARNING, "Max file size exceeded - file [%s] not saved", namebuf); bytes = 0; /* SET_VAR_STRING(namebuf, estrdup("none")); */ - _php3_parse_gpc_data(estrdup("none"), namebuf, http_post_vars); + if(memcmp(namebuf,sbuf,strlen(sbuf))) + _php3_parse_gpc_data(estrdup("none"), namebuf, http_post_vars); } else if ((loc - ptr - 4) <= 0) { bytes = 0; /* SET_VAR_STRING(namebuf, estrdup("none")); */ - _php3_parse_gpc_data(estrdup("none"), namebuf, http_post_vars); + if(memcmp(namebuf,sbuf,strlen(sbuf))) + _php3_parse_gpc_data(estrdup("none"), namebuf, http_post_vars); } else { fp = fopen(fn, "w"); if (!fp) {

« previous php.cvs (#2081) next »