Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:95129 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 11419 invoked from network); 14 Aug 2016 08:21:20 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 14 Aug 2016 08:21:20 -0000 Authentication-Results: pb1.pair.com smtp.mail=smalyshev@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=smalyshev@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.192.194 as permitted sender) X-PHP-List-Original-Sender: smalyshev@gmail.com X-Host-Fingerprint: 209.85.192.194 mail-pf0-f194.google.com Received: from [209.85.192.194] ([209.85.192.194:35007] helo=mail-pf0-f194.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id B2/3A-36656-EF920B75 for ; Sun, 14 Aug 2016 04:21:19 -0400 Received: by mail-pf0-f194.google.com with SMTP id h186so1973793pfg.2 for ; Sun, 14 Aug 2016 01:21:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=subject:to:references:cc:from:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding; bh=m069tBEomHgJOhg4SvpEIUWLgpG2rQcU2FDhDJ+7E2E=; b=swhx6vOoNJrn8Sv/D5Q6mryqi3SUNJua0M+M1BTwdQBn1+Dzj0rbzktqvmPHd1u5eH thVG3hyusJn+8FyjjyFxS6vXB18YPiiuGapup/r0qw4Cu17Un++O4i8+h9cx5doaW9LD gBV30uOp2ruX/krJBScaCbd5/a21B/3/yx+ggzz0882Fu40lHNAXveson4nFhBneXr+h 1PNIUYnOHENUJ2DZ2Hvr7FbeSQ1rnZEnx2w9rDxEmiVAFw0wS6+E5ZfWn+EO2vrt80mX d1CoBSvU3aagsdd4UGGWaDzTC05bXOIN5URLZKB8OKUW5iSe9TSJdsx2cJ5Vhr9NZh0W SzgQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:to:references:cc:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=m069tBEomHgJOhg4SvpEIUWLgpG2rQcU2FDhDJ+7E2E=; b=U1k7oziWhIbBEsh4mbOILf4PjbpO1fSHGBRvl0xEDEACCtFQ2JZAa8Q360oleRoxJw PxS2bMZRTZp0QvshxyhJBFXts9oawWj+WG5AeiNgee7iJHAdJue5bZk9kNbKUBxPrkrn 9Gz/KmiY2C80TqeNx485L0hcdROqfvgXi8YHyHJUkkryoTGm0Zo20QjvggQTJxE4mQ8M csv51b2wH0Xx9kSkz6kak2WoMOGxOD5gByRxdXei17GaM1ywJf7jDPIvvmzJiwNVW30t Yg3nvL2nqkq2MFuUBbAkZwuzNq4dFhg0gkRHTgup9nrC2fV/UYmD5QBgTCFxb2PNj2Sx gH1g== X-Gm-Message-State: AEkooutzPpi85HxdejNEyILpmeyAcmlYkiWsqda6pAD8HzdsrTXhSjV9hFlzPg+60JxeCQ== X-Received: by 10.98.193.1 with SMTP id i1mr42997824pfg.66.1471162875787; Sun, 14 Aug 2016 01:21:15 -0700 (PDT) Received: from Stas-Air.local (108-233-206-104.lightspeed.sntcca.sbcglobal.net. [108.233.206.104]) by smtp.gmail.com with ESMTPSA id t7sm24678030paz.21.2016.08.14.01.21.14 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 14 Aug 2016 01:21:14 -0700 (PDT) To: "Christoph M. Becker" , Nikita Popov References: <85e38ba1-58d4-f8a7-33d4-5f4aa7fce44d@gmx.de> Cc: internals@lists.php.net Message-ID: <19a35995-a032-3413-cade-919d60d33875@gmail.com> Date: Sun, 14 Aug 2016 01:21:13 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: <85e38ba1-58d4-f8a7-33d4-5f4aa7fce44d@gmx.de> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] Bug #72828 From: smalyshev@gmail.com (Stanislav Malyshev) Hi! > You have commented on : > > | Unless the allocations explicitly use the system allocator (i.e. do > | not use emalloc and variants), do NOT introduce NULL checks. > > Can you please elaborate, why that shouldn't be done. > > Actually, the allocations use safe_emalloc() and emalloc(), > respectively[1]. However, the only client of the function does These do not need null checks. If e* functions can't alloc memory, they produce fatal error, bail out and do not return. So if it returned, it succeeded. The only reason why it can return null is a bug. In this case we'd prefer it crashing fast - bugs in memory allocator are hard to find, and closer to the source the crash is, easier it to catch it. If pe* or system functions are used, then check may be warranted. -- Stas Malyshev smalyshev@gmail.com