From 9028b3706ee4faa79dcf5cd01864e03c47b1c30b Mon Sep 17 00:00:00 2001 From: David Carlier Date: Sun, 7 Sep 2025 21:57:07 +0100 Subject: [PATCH] Fix GH-19751: imagefill buffer overflow. --- ext/gd/libgd/gd.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/ext/gd/libgd/gd.c b/ext/gd/libgd/gd.c index 0bd6e4b587e9f..2109c807575c7 100644 --- a/ext/gd/libgd/gd.c +++ b/ext/gd/libgd/gd.c @@ -2043,6 +2043,12 @@ static void _gdImageFillTiled(gdImagePtr im, int x, int y, int nc) FILL_PUSH(y+1, x, x, -1); while (sp>stack) { FILL_POP(y, x1, x2, dy); + if (y> im->sy) { + y = im->sy; + } + if (x> im->sx) { + x = im->sx; + } for (x=x1; x>=0 && (!pts[y][x] && gdImageGetPixel(im,x,y)==oc); x--) { nc = gdImageTileGet(im,x,y); pts[y][x] = 1;

AltStyle によって変換されたページ (->オリジナル) /