iliaa           Thu Jan 26 15:47:32 2006 UTC

  Added files:                 (Branch: PHP_4_4)
    /php-src/ext/standard/tests/strings bug36148.phpt 

  Modified files:              
    /php-src    NEWS 
    /php-src/ext/standard       pack.c 
  Log:
  MFH: Fixed bug #36148 (unpack("H*hex", $data) is adding an extra character 
  to the end of the string). 
  
  
http://cvs.php.net/viewcvs.cgi/php-src/NEWS?r1=1.1247.2.920.2.112&r2=1.1247.2.920.2.113&diff_format=u
Index: php-src/NEWS
diff -u php-src/NEWS:1.1247.2.920.2.112 php-src/NEWS:1.1247.2.920.2.113
--- php-src/NEWS:1.1247.2.920.2.112     Sun Jan 15 22:01:47 2006
+++ php-src/NEWS        Thu Jan 26 15:47:31 2006
@@ -2,6 +2,8 @@
 |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
 ?? ??? 2006, Version 4.4.3
 - Added a check for special characters in the session name. (Ilia)
+- Fixed bug #36148 (unpack("H*hex", $data) is adding an extra character to the 
+  end of the string). (Ilia)
 - Fixed bug #36017 (fopen() crashes PHP when opening a URL). (Tony)
 
 13 Jan 2006, Version 4.4.2
http://cvs.php.net/viewcvs.cgi/php-src/ext/standard/pack.c?r1=1.40.2.7.2.4&r2=1.40.2.7.2.5&diff_format=u
Index: php-src/ext/standard/pack.c
diff -u php-src/ext/standard/pack.c:1.40.2.7.2.4 
php-src/ext/standard/pack.c:1.40.2.7.2.5
--- php-src/ext/standard/pack.c:1.40.2.7.2.4    Sun Jan  1 13:46:57 2006
+++ php-src/ext/standard/pack.c Thu Jan 26 15:47:31 2006
@@ -15,7 +15,7 @@
    | Author: Chris Schneider <[EMAIL PROTECTED]>                          |
    +----------------------------------------------------------------------+
  */
-/* $Id: pack.c,v 1.40.2.7.2.4 2006/01/01 13:46:57 sniper Exp $ */
+/* $Id: pack.c,v 1.40.2.7.2.5 2006/01/26 15:47:31 iliaa Exp $ */
 
 #include "php.h"
 
@@ -693,7 +693,9 @@
                                                        len = size * 2;
                                                } 
 
-                                               len -= argb % 2;
+                                               if (argb > 0) { 
+                                                       len -= argb % 2;
+                                               }
 
                                                buf = emalloc(len + 1);
 

http://cvs.php.net/viewcvs.cgi/php-src/ext/standard/tests/strings/bug36148.phpt?view=markup&rev=1.1
Index: php-src/ext/standard/tests/strings/bug36148.phpt
+++ php-src/ext/standard/tests/strings/bug36148.phpt

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to