]> granicus.if.org Git - php/commitdiff
MFH: Fixed bug #31465 (False warning in unpack() when working with *).
authorIlia Alshanetsky <iliaa@php.net>
Tue, 25 Jan 2005 22:52:19 +0000 (22:52 +0000)
committerIlia Alshanetsky <iliaa@php.net>
Tue, 25 Jan 2005 22:52:19 +0000 (22:52 +0000)
NEWS
ext/standard/pack.c

diff --git a/NEWS b/NEWS
index 4643372392948e8c398e6c69a576ccf3918d6ecd..c758858f65c7efdbed145f563efafa2725b6977d 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -13,6 +13,7 @@ PHP 4                                                                      NEWS
 - Fixed bug #31580 (fgetcsv() problematic with "" escape sequences). (Ilia)
 - Fixed bug #31480 (Possible infinite loop in imap_mail_compose()). (Ilia)
 - Fixed bug #31479 (Fixed crash in chunk_split(), when chunklen > strlen). (Ilia)
+- Fixed bug #31465 (False warning in unpack() when working with *). (Ilia)
 - Fixed bug #31454 (session_set_save_handler crashes PHP when supplied
   non-existent object ref). (Tony)
 - Fixed bug #31444 (Memory leak in zend_language_scanner.c).
index adef56a2f3843f8867fdc0bfff4d75070f3ca1f0..a6a32bdc550abacbf8a4650ae072312b4ca74690 100644 (file)
@@ -833,7 +833,9 @@ PHP_FUNCTION(unpack)
 
                                inputpos += size;
                                if (inputpos < 0) {
-                                       php_error_docref(NULL TSRMLS_CC, E_WARNING, "Type %c: outside of string", type);
+                                       if (size != -1) { /* only print warning if not working with * */
+                                               php_error_docref(NULL TSRMLS_CC, E_WARNING, "Type %c: outside of string", type);
+                                       }
                                        inputpos = 0;
                                }
                        } else if (arg < 0) {