libextractor

GNU libextractor
Log | Files | Refs | Submodules | README | LICENSE

commit 774014cdbdf1e5565ff3ad16cb9e8c983ed06369
parent 85daaa3242c01d9c116626fbe90bcc5ea5a2e4d0
Author: Christian Grothoff <christian@grothoff.org>
Date:   Sun, 15 Oct 2017 20:36:55 +0200

handle allocation failure in PDF fdopen call

Diffstat:
Msrc/plugins/pdf_extractor.c | 9++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/src/plugins/pdf_extractor.c b/src/plugins/pdf_extractor.c @@ -191,7 +191,14 @@ EXTRACTOR_pdf_extract_method (struct EXTRACTOR_ExtractContext *ec) close (in[0]); close (out[1]); fout = fdopen (out[0], "r"); - + if (NULL == fout) + { + close (in[1]); + close (out[0]); + kill (pid, SIGKILL); + waitpid (pid, NULL, 0); + return; + } pos = 0; while (pos < fsize) {