From: Thies C. Arntzen Date: Sun, 6 Feb 2000 15:18:59 +0000 (+0000) Subject: @- Fixed possible buffer-overflow in base64_decode. (Thies) X-Git-Tag: BEFORE_SAPIFICATION_FEB_10_2000~61 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=90ac20ebb593297d84026c815a3b8e14c0ed9e3e;p=php @- Fixed possible buffer-overflow in base64_decode. (Thies) fix #3226 --- diff --git a/ext/standard/base64.c b/ext/standard/base64.c index 521ccccbf9..0e0192ca16 100644 --- a/ext/standard/base64.c +++ b/ext/standard/base64.c @@ -88,7 +88,7 @@ unsigned char *php_base64_decode(const unsigned char *string, int length, int *r } } - result = (unsigned char *)emalloc((length / 4 * 3 + 1) * sizeof(char)); + result = (unsigned char *)emalloc(length + 1); if (result == NULL) { return NULL; }