cvs: /php3 ChangeLog /php3/functions base64.c
| From: | Thies C. Arntzen | Date: | Sun, 06 Feb 2000 15:16:18 +0000 |
| Subject: | cvs: /php3 ChangeLog /php3/functions base64.c | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-15252@lists.php.net to get a copy of this message | ||
thies Sun Feb 6 07:16:18 2000 EDT
Modified files:
/php3 ChangeLog
/php3/functions base64.c
Log:
fix for #3226 (buffer overflow in base64_decode)
Index: php3/ChangeLog
diff -u php3/ChangeLog:1.818 php3/ChangeLog:1.819
--- php3/ChangeLog:1.818 Sun Feb 6 06:41:48 2000
+++ php3/ChangeLog Sun Feb 6 07:16:17 2000
@@ -2,6 +2,7 @@
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
???, Version 3.0.15
+- Fixed possible buffer-overflow in base64_decode(). (Thies)
- Fixed possible buffer-overflow in setcookie(). (Thies)
- Added ImageWbmp() for outputting WAP's Wireless Bitmaps (markonen)
- Support for LZW-compressed GIFs with gd 1.5, gd/freetype cleanups (markonen)
Index: php3/functions/base64.c
diff -u php3/functions/base64.c:1.32 php3/functions/base64.c:1.33
--- php3/functions/base64.c:1.32 Fri Dec 31 20:31:14 1999
+++ php3/functions/base64.c Sun Feb 6 07:16:18 2000
@@ -26,7 +26,7 @@
| Author: Jim Winstead (jimw@php.net) |
+----------------------------------------------------------------------+
*/
-/* $Id: base64.c,v 1.32 2000/01/01 04:31:14 sas Exp $ */
+/* $Id: base64.c,v 1.33 2000/02/06 15:16:18 thies Exp $ */
#include <string.h>
@@ -85,7 +85,8 @@
int ch, i = 0, j = 0, k;
char *chp;
- unsigned char *result = (unsigned char *)emalloc((length / 4 * 3 + 1) * sizeof(char));
+ unsigned char *result = (unsigned char *)emalloc(length + 1);
+
if (result == NULL) {
return NULL;
}