From 43f2c1076467570fbd999116eb42266ec2b6cc78 Mon Sep 17 00:00:00 2001 Message-ID: <43f2c1076467570fbd999116eb42266ec2b6cc78.1735230633.git.mjg@fedoraproject.org> From: Sebastian Rasmussen Date: Mon, 2 Sep 2024 22:06:32 +0200 Subject: [PATCH] Bug 707996: Declare variable fz_var to avoid stale values. A fuzzed file provoked an ASAN warning when building release mode. For good measure, also declare a variable in an unrelated function in the same tool fz_var. (cherry picked from commit b5c898a30f068b5342e8263a2cd5b9f0be291aac) --- source/tools/pdfextract.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/source/tools/pdfextract.c b/source/tools/pdfextract.c index 0b42e9189..dc1f2c23f 100644 --- a/source/tools/pdfextract.c +++ b/source/tools/pdfextract.c @@ -119,6 +119,7 @@ static void saveimage(pdf_obj *ref) int type; fz_var(image); + fz_var(mask); fz_var(pix); fz_try(ctx) @@ -252,7 +253,9 @@ static void savefont(pdf_obj *dict) static void extractobject(int num) { - pdf_obj *ref; + pdf_obj *ref = NULL; + + fz_var(ref); if (!doc) fz_throw(ctx, FZ_ERROR_GENERIC, "no file specified"); -- 2.48.0.rc0.310.g2fcc1078a8