Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:98335 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 25128 invoked from network); 22 Feb 2017 02:21:54 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 22 Feb 2017 02:21:54 -0000 Authentication-Results: pb1.pair.com smtp.mail=php@golemon.com; spf=softfail; sender-id=softfail Authentication-Results: pb1.pair.com header.from=php@golemon.com; sender-id=softfail Received-SPF: softfail (pb1.pair.com: domain golemon.com does not designate 74.125.82.53 as permitted sender) X-PHP-List-Original-Sender: php@golemon.com X-Host-Fingerprint: 74.125.82.53 mail-wm0-f53.google.com Received: from [74.125.82.53] ([74.125.82.53:37107] helo=mail-wm0-f53.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id CC/43-11648-1C5FCA85 for ; Tue, 21 Feb 2017 21:21:53 -0500 Received: by mail-wm0-f53.google.com with SMTP id v77so224449wmv.0 for ; Tue, 21 Feb 2017 18:21:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=golemon-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:from:date:message-id:subject:to; bh=5wMkK6/me8skMkfxjVrQtMMuoyxcBSxIZwy8gLPQEAI=; b=qbWHhRmA0m9frwuGa5OHqwF74q2cG6UgjzTxJa1eJU938sQgh+0AJfN/IH1CeKZM0D n/QvFpge79Af/30lHY3Sig2zA66KNYj5f/72D69IjGykV23gCHLO2DkXnNeCf6VKSE8q duAhvwtzwow1qZvyMNL2OqMnyhT7RIinSBd5lMAa6Nk/EUCYFZgjCMNN+hBdACuOpTc1 H/IHwLcAksO6oH/+AV60LOSvPZ3UWC/e98mqjczHcOIFVFj05fXFgjEBxs84w2PJtn8w kiJc16pLs5iTPZRxLWHZilTFkAMbvx4EQ501JkRotZ8VAAkrOjXlml9KikG/F1fn/Voc kC7Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:from:date:message-id:subject :to; bh=5wMkK6/me8skMkfxjVrQtMMuoyxcBSxIZwy8gLPQEAI=; b=cbZ+r2Yd9uZThmhWMh8MtDqyY3q9m0KijCC4wF/V/AZuD1OGvUjd9KB46tt47N4Lq7 fYpPDAhIVTP4L8tvaffrJ0dzkewp9usj1xrPc6JArnb7linJ9Vy1aDqXy4DgO3nkaSct xheu7LAB4c9FleDy6q3HkImJtEwwY69Y/YxBvLVEFcucVe76E3VR4KZuD9z1JCxBhiGS IptAcL6ABh32S8HkGMVDmFg800I/T0wLYf7n8XTwbnALK9Mn3YkthGvnoMDIFI04BfrH goD2qc8Ql6Dc4GT/vPceYNRMpSE8y5EyRf1EztWlbWTGOAtK/zRKcH9oVoJmo/1QblTN 2PPQ== X-Gm-Message-State: AMke39laSVL23OBle7nMjfw2hwwCjBR7+ez07Mx2lFXp7Al0p0kCVsDg2Me2fxjh46c7YMMLJVsSHYQqstBcwA== X-Received: by 10.28.195.70 with SMTP id t67mr177921wmf.98.1487730110052; Tue, 21 Feb 2017 18:21:50 -0800 (PST) MIME-Version: 1.0 Sender: php@golemon.com Received: by 10.223.152.233 with HTTP; Tue, 21 Feb 2017 18:21:49 -0800 (PST) X-Originating-IP: [73.9.224.155] Date: Tue, 21 Feb 2017 20:21:49 -0600 X-Google-Sender-Auth: GbzrmX6lEoklaKd2EHeGZ7oXWbg Message-ID: To: PHP internals Content-Type: text/plain; charset=UTF-8 Subject: Fix for invalid declare(ticks=expr); values From: pollita@php.net (Sara Golemon) A crash report came into security@ (which needn't have been private) about a segfault in response to trying to compile clearly broken code. https://github.com/php/php-src/pull/2395 is a fix for this, but before I merge it (and check how far back it goes -- my suspicion is 7.0), I'm hoping for some feedback about the approach. In short: It reduces the footprint for declare values from "any expression" to "number and string literals". This technically could break existing code since right now something like `declare(ticks=array())` is technically valid... even if terrible. An alternate fix (and perhaps something to do in addition to this fix) would be to add a check in zend_compile.c to verify that the value type is ZEND_AST_ZVAL. -Sara