Skip to content

Commit

Permalink
Bug 707996: Declare variable fz_var to avoid stale values.
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
sebras committed Sep 2, 2024
1 parent 1d58f73 commit b5c898a
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion source/tools/pdfextract.c
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ static void saveimage(pdf_obj *ref)
int type;

fz_var(image);
fz_var(mask);
fz_var(pix);

fz_try(ctx)
Expand Down Expand Up @@ -251,7 +252,9 @@ static void savefont(pdf_obj *dict)

static void extractobject(int num)
{
pdf_obj *ref;
pdf_obj *ref = NULL;

fz_var(ref);

fz_try(ctx)
{
Expand Down

0 comments on commit b5c898a

Please sign in to comment.