Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:80968 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 91509 invoked from network); 22 Jan 2015 10:37:11 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 22 Jan 2015 10:37:11 -0000 Authentication-Results: pb1.pair.com smtp.mail=yohgaki@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=yohgaki@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.192.44 as permitted sender) X-PHP-List-Original-Sender: yohgaki@gmail.com X-Host-Fingerprint: 209.85.192.44 mail-qg0-f44.google.com Received: from [209.85.192.44] ([209.85.192.44:52543] helo=mail-qg0-f44.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id AE/55-61273-6D2D0C45 for ; Thu, 22 Jan 2015 05:37:10 -0500 Received: by mail-qg0-f44.google.com with SMTP id l89so509176qgf.3 for ; Thu, 22 Jan 2015 02:37:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc:content-type; bh=J00qAyRxvWDVlNTKYTbE33s3zAn8EoazWCCH7gTCOsU=; b=kzC4jgJnoV21oCzyW+HF0y4mgA4IAA8ppdis2FlF/ImYuEUCvxTwvk7gtU9vsmwdfU Frd43zb12hVn35VzVqgx2yuguATqW/rxNs5aTHiyaC7WkeQ2hCuHAxERMhx4PuFLYVL/ fySDllgQ7xJUAKreUtZhgGUMZGI3FN7XgxxmPUeFLC/Kfx2ddPfCY7lYoQep4eZjk4a4 GB53o9tx9FnzHGcGbG+Lz7kHRB99UqsZtY+r49EgEurOVzLaTWffjTDG4dw/HivPWIwW a9LtzJLqeoETKeQwptrd6g2Fwqe7bbivqsBU/wux3koaKpmdSEzBTVvLuhoa8VKzz75B T2+w== X-Received: by 10.224.121.79 with SMTP id g15mr1163041qar.68.1421923028028; Thu, 22 Jan 2015 02:37:08 -0800 (PST) MIME-Version: 1.0 Sender: yohgaki@gmail.com Received: by 10.229.93.70 with HTTP; Thu, 22 Jan 2015 02:36:27 -0800 (PST) In-Reply-To: <1421785688-23331-1-git-send-email-git@internot.info> References: <1421785688-23331-1-git-send-email-git@internot.info> Date: Thu, 22 Jan 2015 19:36:27 +0900 X-Google-Sender-Auth: XnQP1vvdhSYjfNznvZLQGjpn-4I Message-ID: To: Joshua Rogers Cc: "internals@lists.php.net" Content-Type: multipart/alternative; boundary=089e015371d0fbd4ff050d3b40b8 Subject: Re: [PHP-DEV] [PATCH] Fix uninitalized variables reads. See CWE-457 for more info. From: yohgaki@ohgaki.net (Yasuo Ohgaki) --089e015371d0fbd4ff050d3b40b8 Content-Type: text/plain; charset=UTF-8 Hi Joshua, On Wed, Jan 21, 2015 at 5:28 AM, Joshua Rogers wrote: > ext/mbstring/mbstring.c | 8 ++++---- > ext/reflection/php_reflection.c | 1 + > main/main.c | 1 + > 3 files changed, 6 insertions(+), 4 deletions(-) > > diff --git a/ext/mbstring/mbstring.c b/ext/mbstring/mbstring.c > index 7f2209f..504a5e6 100644 > --- a/ext/mbstring/mbstring.c > +++ b/ext/mbstring/mbstring.c > @@ -3891,7 +3891,7 @@ static int _php_mbstr_parse_mail_headers(HashTable > *ht, const char *str, size_t > int state = 0; > int crlf_state = -1; > char *token = NULL; > - size_t token_pos; > + size_t token_pos = 0; > zend_string *fld_name, *fld_val; > > ps = str; > @@ -3917,7 +3917,7 @@ static int _php_mbstr_parse_mail_headers(HashTable > *ht, const char *str, size_t > } > > if (state == 0 || state == 1) { > - if(token) { > + if(token && token_pos > 0) { > fld_name = > zend_string_init(token, token_pos, 0); > } > state = 2; > @@ -3983,7 +3983,7 @@ static int _php_mbstr_parse_mail_headers(HashTable > *ht, const char *str, size_t > > case 3: > if (crlf_state == -1) { > - if(token) { > + if(token && > token_pos > 0) { > fld_val = > zend_string_init(token, token_pos, 0); > } > > @@ -4032,7 +4032,7 @@ out: > state = 3; > } > if (state == 3) { > - if(token) { > + if(token && token_pos > 0) { > fld_val = zend_string_init(token, token_pos, 0); > } > if (fld_name != NULL && fld_val != NULL) { > diff --git a/ext/reflection/php_reflection.c > b/ext/reflection/php_reflection.c > index 3f5c7a9..1f5085c 100644 > --- a/ext/reflection/php_reflection.c > +++ b/ext/reflection/php_reflection.c > @@ -3978,6 +3978,7 @@ static int _adddynproperty(zval *ptr, int num_args, > va_list args, zend_hash_key > if (zend_get_property_info(ce, hash_key->key, 1) == NULL) { > zend_property_info property_info; > > + property_info.doc_comment = NULL; > property_info.flags = ZEND_ACC_IMPLICIT_PUBLIC; > property_info.name = hash_key->key; > property_info.ce = ce; > diff --git a/main/main.c b/main/main.c > index 3aef805..50d0161 100644 > --- a/main/main.c > +++ b/main/main.c > @@ -2255,6 +2255,7 @@ int php_module_startup(sapi_module_struct *sf, > zend_module_entry *additional_mod > > zuv.html_errors = 1; > zuv.import_use_extension = ".php"; > + zuv.import_use_extension_length = > (uint)strlen(zuv.import_use_extension); > php_startup_auto_globals(); > zend_set_utility_values(&zuv); > php_startup_sapi_content_types(); > Could you send pull request from github? It's not required strictly, but if you can includes tests, it would be great. Regards, -- Yasuo Ohgaki yohgaki@ohgaki.net --089e015371d0fbd4ff050d3b40b8--