iliaa           Sun Jan 25 18:27:58 2009 UTC

  Modified files:              
    /php-src/ext/standard/tests/url     bug47174.phpt 
    /php-src/ext/standard       base64.c 
  Log:
  MFB: Improved fix for bug #47174 & added a test
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/url/bug47174.phpt?r1=1.1&r2=1.2&diff_format=u
Index: php-src/ext/standard/tests/url/bug47174.phpt
diff -u /dev/null php-src/ext/standard/tests/url/bug47174.phpt:1.2
--- /dev/null   Sun Jan 25 18:27:58 2009
+++ php-src/ext/standard/tests/url/bug47174.phpt        Sun Jan 25 18:27:56 2009
@@ -0,0 +1,18 @@
+--TEST--
+Bug #47174 (base64_decode() interprets pad char in mid string as terminator)
+--FILE--
+<?php
+if (base64_decode("dGVzdA==") == base64_decode("dGVzdA==CRAP")) {
+    echo "Same octect data - Signature Valid\n";
+} else {
+    echo "Invalid Signature\n";
+}
+
+$in = base64_encode("foo") . '==' . base64_encode("bar");
+var_dump($in, base64_decode($in));
+
+?>
+--EXPECT--
+Invalid Signature
+string(10) "Zm9v==YmFy"
+string(6) "foobar"
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/base64.c?r1=1.58&r2=1.59&diff_format=u
Index: php-src/ext/standard/base64.c
diff -u php-src/ext/standard/base64.c:1.58 php-src/ext/standard/base64.c:1.59
--- php-src/ext/standard/base64.c:1.58  Wed Jan 21 15:45:45 2009
+++ php-src/ext/standard/base64.c       Sun Jan 25 18:27:58 2009
@@ -15,7 +15,7 @@
    | Author: Jim Winstead <j...@php.net>                                  |
    +----------------------------------------------------------------------+
  */
-/* $Id: base64.c,v 1.58 2009/01/21 15:45:45 iliaa Exp $ */
+/* $Id: base64.c,v 1.59 2009/01/25 18:27:58 iliaa Exp $ */
 
 #include <string.h>
 
@@ -156,7 +156,6 @@
                                efree(result);
                                return NULL;
                        }
-                       i++;
                        continue;
                }
 



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

Reply via email to