Bug #79899 [NEW]: assert() is not binary-safe
| From: | fpoirotte+php-bugs at gmail dot com | Date: | Sun, 26 Jul 2020 18:14:15 +0000 |
| Subject: | Bug #79899 [NEW]: assert() is not binary-safe | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-228232@lists.php.net to get a copy of this message | ||
From: fpoirotte+php-bugs at gmail dot com
Operating system: Debian GNU/Linux Bullseye
PHP version: 7.4.8
Package: Unknown/Other Function
Bug Type: Bug
Bug description:assert() is not binary-safe
Description:
------------
The $description argument of assert() is not binary-safe.
When the description is displayed, it will get truncated at the first
null (\0) byte.
Test script:
---------------
<?php
// run with: php -d zend.assertions=1 -f /tmp/test.php
error_reporting(E_ALL);
ini_set("display_errors", 1);
assert_options(ASSERT_ACTIVE, true);
assert_options(ASSERT_WARNING, true);
assert(false, "foo\000bar");
Expected result:
----------------
Warning: assert(): foobar failed in /tmp/test.php on line 10
Actual result:
--------------
Warning: assert(): foo failed in /tmp/test.php on line 10
--
Edit bug report at https://bugs.php.net/bug.php?id=79899&edit=1
--
Fix committed: https://bugs.php.net/fix.php?id=79899&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=79899&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=79899&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=79899&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=79899&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=79899&r=support
Expected behavior: https://bugs.php.net/fix.php?id=79899&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=79899&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=79899&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=79899&r=globals
PHP version support discontinued: https://bugs.php.net/fix.php?id=79899&r=phptooold
Daylight Savings: https://bugs.php.net/fix.php?id=79899&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=79899&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=79899&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=79899&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=79899&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=79899&r=mysqlcfg