]> granicus.if.org Git - php/commitdiff
MFH: both the check and php_error in the comment
authorMarcus Boerger <helly@php.net>
Thu, 5 Dec 2002 21:02:02 +0000 (21:02 +0000)
committerMarcus Boerger <helly@php.net>
Thu, 5 Dec 2002 21:02:02 +0000 (21:02 +0000)
ext/standard/base64.c

index 18f1e9c5328bf89717853761aa2640de62e11ce0..4defc3f5bba92a24a85198f5425850a73e20f122 100644 (file)
@@ -119,7 +119,7 @@ void php_base64_init()
                ch += 16;
        }
        sprintf(sp, "};");
-       php_error(E_NOTICE,"reverse_table:\n%s", s);
+       php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Reverse_table:\n%s", s);
        efree(s);
 }
 */
@@ -140,7 +140,7 @@ unsigned char *php_base64_decode(const unsigned char *str, int length, int *ret_
        }
 
        /* run through the whole string, converting as we go */
-       while ((ch = *current++) != '\0') {
+       while ((ch = *current++) != '\0' && length-- > 0) {
                if (ch == base64_pad) break;
 
            /* When Base64 gets POSTed, all pluses are interpreted as spaces.