From 413ac8effd48a1aadb3bf78394d96ba00f2bc105 Mon Sep 17 00:00:00 2001 From: Niels Dossche <7771979+nielsdos@users.noreply.github.com> Date: Sat, 13 Jan 2024 17:04:36 +0100 Subject: [PATCH] Follow-up fix for GH-13082 The font_obj should actually be NULL initialised, not the font gd pointer. --- ext/gd/gd.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/ext/gd/gd.c b/ext/gd/gd.c index c86a663c5b7c..509a5e476062 100644 --- a/ext/gd/gd.c +++ b/ext/gd/gd.c @@ -2749,9 +2749,8 @@ static void php_imagechar(INTERNAL_FUNCTION_PARAMETERS, int mode) gdImagePtr im; int ch = 0, col, x, y, i, l = 0; unsigned char *str = NULL; - zend_object *font_obj; + zend_object *font_obj = NULL; zend_long font_int = 0; - gdFontPtr font = NULL; ZEND_PARSE_PARAMETERS_START(6, 6) Z_PARAM_OBJECT_OF_CLASS(IM, gd_image_ce) @@ -2776,7 +2775,7 @@ static void php_imagechar(INTERNAL_FUNCTION_PARAMETERS, int mode) y = Y; x = X; - font = php_find_gd_font(font_obj, font_int); + gdFontPtr font = php_find_gd_font(font_obj, font_int); switch (mode) { case 0: