From e8795126ead944a345c47d6ec16b6e5b8f11d3e1 Mon Sep 17 00:00:00 2001 From: Felipe Pena Date: Fri, 4 Apr 2008 17:39:52 +0000 Subject: [PATCH] Fixed bug #44591 (imagegif's filename parameter) --- NEWS | 1 + ext/gd/gd.c | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/NEWS b/NEWS index 04a26c528d597..0c16d62587c03 100644 --- a/NEWS +++ b/NEWS @@ -1,6 +1,7 @@ PHP NEWS ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| ?? Apr 2008, PHP 5.2.6 +- Fixed bug #44591 (imagegif's filename parameter). (Felipe) 03 Apr 2008, PHP 5.2.6RC4 - Fixed possible stack buffer overflow in FastCGI SAPI. (Andrei Nigmatulin) diff --git a/ext/gd/gd.c b/ext/gd/gd.c index 476231d730a8b..c803eecc74dbf 100644 --- a/ext/gd/gd.c +++ b/ext/gd/gd.c @@ -2813,7 +2813,7 @@ static void _php_image_output(INTERNAL_FUNCTION_PARAMETERS, int image_type, char } } - if ((argc == 2) || (argc > 2 && Z_STRLEN_PP(file))) { + if (argc >= 2 && Z_STRLEN_PP(file)) { PHP_GD_CHECK_OPEN_BASEDIR(fn, "Invalid filename"); fp = VCWD_FOPEN(fn, "wb");