Bug #70542 [Opn]: dcngettext test crash due to invalid "category" parameter

From: Date: Sat, 24 Oct 2015 05:01:48 +0000
Subject: Bug #70542 [Opn]: dcngettext test crash due to invalid "category" parameter
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-196780@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=70542&edit=1 ID: 70542 Updated by: kalle@php.net Reported by: rainer dot jung at kippdata dot de Summary: dcngettext test crash due to invalid "category" parameter Status: Open Type: Bug Package: Gettext related Operating System: Solaris PHP Version: 7.0.0RC3 Block user comment: N Private report: N New Comment: I think we should fix this at the source itself, while also fixing the tests on the side. Since we now know that the underlying library may segfault if we pass an unexpected value from the outside to it, we may as well have a check before calling dcngettext() (or any other function using a $category parameter in ext/gettext) to ensure its not possible to cause a crash. Previous Comments: ------------------------------------------------------------------------ [2015-09-24 16:24:28] rainer dot jung at kippdata dot de Confirmed, the patch works. ------------------------------------------------------------------------ [2015-09-24 13:51:17] rainer dot jung at kippdata dot de I'll now attach a yet untested but suggested patch. First I started adding the LC_ constants to gettext but then I noticed, that those constants already exist in core PHP, so the patch is just a small change to the tests. I currently run a fresh build and then will execute the full test suite and then report back, whether the patch actually did work for me. ------------------------------------------------------------------------ [2015-09-23 06:33:13] laruence@php.net do you have a suggest patch? ------------------------------------------------------------------------ [2015-09-22 05:57:43] rainer dot jung at kippdata dot de Sure, it is *not* happening on Linux. That's why I assigned it to Solaris and wrote "Linux has special provisions in the source code for invalid category values, but on Solaris invalid values make the test crash." ------------------------------------------------------------------------ [2015-09-22 04:05:09] laruence@php.net I can not reproduce this on Linux ------------------------------------------------------------------------ The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at https://bugs.php.net/bug.php?id=70542 -- Edit this bug report at https://bugs.php.net/bug.php?id=70542&edit=1

« previous php.bugs (#196780) next »