Skip to content

Commit

Permalink
oss-fuzz 43680: Cope with out-of-memory error in stack extension
Browse files Browse the repository at this point in the history
The minimal PS-like interpreter in pdfi allows the operand stand to be extended,
but the code was missing handling of the memory allocation failing for the
extended stack.
  • Loading branch information
chris-liddell committed Jan 18, 2022
1 parent dc6a54d commit e5187d4
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion pdf/pdf_fontps.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* Copyright (C) 2020-2021 Artifex Software, Inc.
/* Copyright (C) 2020-2022 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
Expand Down Expand Up @@ -201,6 +201,9 @@ static inline int pdf_ps_stack_push(pdf_ps_ctx_t *s)
s->cur = s->stack + currsize - 1;
s->toplim = s->stack + newsize - PDF_PS_STACK_GROW_SIZE;
}
else {
return_error(gs_error_VMerror);
}
}
}
s->cur++;
Expand Down

0 comments on commit e5187d4

Please sign in to comment.