moriyoshi Sun Jan 12 16:05:23 2003 EDT
Modified files:
/php4/ext/standard filters.c
Log:
Fixed a bug of the base64 decoder that a sequence of intervening
characters that are supposed to be ignored by the decoder cause output
corruption.
Index: php4/ext/standard/filters.c
diff -u php4/ext/standard/filters.c:1.12 php4/ext/standard/filters.c:1.13
--- php4/ext/standard/filters.c:1.12 Sun Jan 12 08:46:11 2003
+++ php4/ext/standard/filters.c Sun Jan 12 16:05:22 2003
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: filters.c,v 1.12 2003/01/12 13:46:11 moriyoshi Exp $ */
+/* $Id: filters.c,v 1.13 2003/01/12 21:05:22 moriyoshi Exp $ */
#include "php.h"
#include "php_globals.h"
@@ -526,9 +526,6 @@
}
if ((pack_bcnt | ustat) == 0) {
if (ocnt < 1) {
- urem |= (pack << urem_nbits);
- urem_nbits += 8;
-
err = PHP_CONV_ERR_TOO_BIG;
break;
}
@@ -537,6 +534,14 @@
pack = 0;
pack_bcnt = nbitsof_pack;
}
+ }
+
+ if (urem_nbits >= pack_bcnt) {
+ urem |= (pack << (urem_nbits - pack_bcnt));
+ urem_nbits += (nbitsof_pack - pack_bcnt);
+ } else {
+ urem |= (pack >> (pack_bcnt - urem_nbits));
+ urem_nbits += (nbitsof_pack - pack_bcnt);
}
inst->urem = urem;
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php