From 90ac20ebb593297d84026c815a3b8e14c0ed9e3e Mon Sep 17 00:00:00 2001 From: "Thies C. Arntzen" Date: Sun, 6 Feb 2000 15:18:59 +0000 Subject: [PATCH] @- Fixed possible buffer-overflow in base64_decode. (Thies) fix #3226 --- ext/standard/base64.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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; } -- 2.50.1