]> granicus.if.org Git - php/commitdiff
MFH: Fixed bug #27384 (unpack() misbehaves with 1 char string). (GeorgeS)
authorfoobar <sniper@php.net>
Wed, 25 Feb 2004 12:36:24 +0000 (12:36 +0000)
committerfoobar <sniper@php.net>
Wed, 25 Feb 2004 12:36:24 +0000 (12:36 +0000)
NEWS
ext/standard/pack.c

diff --git a/NEWS b/NEWS
index c41daa3a0e61756e0368c3b9122eaa6ffd2dcea1..d12ef3c31c2ab839482466b620d7d1432c1cf968 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -1,6 +1,7 @@
 PHP 4                                                                      NEWS
 |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
 ?? Feb 2004, Version 4.3.5
+- Fixed bug #27384 (unpack() misbehaves with 1 char string). (GeorgeS)
 - Fixed bug #27383 (Potential crash inside fopen_wrapper, while parsing
   response code). (Ilia)
 - Fixed bug #27341 (HEAD requests fail to return data). (Ilia)
index cce7913a9ab8093167646fc81607f6741bef1cd6..750bec3a4d66c21931f887c5ee8bcc3c4e12cdc1 100644 (file)
@@ -642,7 +642,7 @@ PHP_FUNCTION(unpack)
                        /* Space for name + number, safe as namelen is ensured <= 200 */
                        char n[256];
 
-                       if (arg != 1) {
+                       if (arg != 1 || namelen == 0) {
                                /* Need to add element number to name */
                                sprintf(n, "%.*s%d", namelen, name, i + 1);
                        } else {