Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:95722 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 76631 invoked from network); 7 Sep 2016 09:20:46 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 7 Sep 2016 09:20:46 -0000 Authentication-Results: pb1.pair.com smtp.mail=yohgaki@ohgaki.net; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=yohgaki@ohgaki.net; sender-id=pass Received-SPF: pass (pb1.pair.com: domain ohgaki.net designates 180.42.98.130 as permitted sender) X-PHP-List-Original-Sender: yohgaki@ohgaki.net X-Host-Fingerprint: 180.42.98.130 ns1.es-i.jp Received: from [180.42.98.130] ([180.42.98.130:54897] helo=es-i.jp) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 4B/49-18051-7EBDFC75 for ; Wed, 07 Sep 2016 05:20:45 -0400 Received: (qmail 89302 invoked by uid 89); 7 Sep 2016 09:20:34 -0000 Received: from unknown (HELO mail-qk0-f175.google.com) (yohgaki@ohgaki.net@209.85.220.175) by 0 with ESMTPA; 7 Sep 2016 09:20:34 -0000 Received: by mail-qk0-f175.google.com with SMTP id w204so5813707qka.0 for ; Wed, 07 Sep 2016 02:20:34 -0700 (PDT) X-Gm-Message-State: AE9vXwMoKGxISock0Iq+nN11ZvjeDqEL01ne50wpArzI+mXgrKTPv5hetuCNp4Q+rbetPGWIj1jjfjKoEeXmsw== X-Received: by 10.55.153.68 with SMTP id b65mr51697675qke.10.1473240027197; Wed, 07 Sep 2016 02:20:27 -0700 (PDT) MIME-Version: 1.0 Received: by 10.140.84.168 with HTTP; Wed, 7 Sep 2016 02:19:46 -0700 (PDT) In-Reply-To: References: Date: Wed, 7 Sep 2016 18:19:46 +0900 X-Gmail-Original-Message-ID: Message-ID: To: "internals@lists.php.net" Content-Type: text/plain; charset=UTF-8 Subject: Re: PHP_INI_MH()'s new_value_length being non-zero for NULL new_value? From: yohgaki@ohgaki.net (Yasuo Ohgaki) On Wed, Sep 7, 2016 at 5:46 PM, Yasuo Ohgaki wrote: > I realized that setting default_charset does not set > *.internal_encoding/etc. So I looked into what's wrong and found > > PHP_INI_MH()'s new_value_length being non-zero for NULL new_value. > > This makes fail to set proper value for *.intermal_encoding/etc. This > happens from PHP 5.6 branch. It was 0 for null value otherwise > encoding setting was not working from the beginning. > > Is this change intended or a bug? > Or I got zero length during patch development by accident? > > If this behavior wouldn't be changed, I'll just commit patch that fix > the encoding INI issue. It seems it was by accident. new_value_length would be uninitialized value because of PHPAPI zval *cfg_get_entry(const char *name, uint name_length) { zval *tmp; if (zend_hash_find(&configuration_hash, name, name_length, (void **) &tmp) == SUCCESS) { return tmp; } else { return NULL; } } when there is no ini definition at all. I'll just fix code inside PHP_INI_MH(). Regards, -- Yasuo Ohgaki yohgaki@ohgaki.net