Bug 698886

Summary: oss-fuzz 5501: Assert triggered in pdf_store
Product: MuPDF Reporter: Sebastian Rasmussen <sebastian.rasmussen>
Component: mupdfAssignee: Sebastian Rasmussen <sebastian.rasmussen>
Status: RESOLVED FIXED    
Severity: normal    
Priority: P4    
Version: unspecified   
Hardware: PC   
OS: Linux   
Customer: Word Size: ---
Attachments: Minimized PDF from oss-fuzz.

Description Sebastian Rasmussen 2018-01-22 06:26:13 UTC
Created attachment 14617 [details]
Minimized PDF from oss-fuzz.

Running

build/sanitize/mutool draw -s t ./oss-fuzz-5501.pdf

causes

error: cannot recognize xref format
warning: trying to repair broken xref
warning: repairing PDF document
error: invalid key in dict
warning: invalid indirect reference in dict
warning: object missing 'endobj' token
warning: lexical error (unexpected '>')
error: invalid key in dict
error: invalid key in dict
warning: ignoring broken object (7 0 R)
warning: invalid indirect reference in dict
warning: lexical error (unexpected '>')
error: invalid key in dict
warning: ignoring broken object (21 0 R)
error: invalid key in dict
warning: cannot load object (7 0 R) into cache
error: invalid key in dict
warning: cannot load object (7 0 R) into cache
error: invalid key in dict
warning: cannot load object (7 0 R) into cache
error: invalid key in dict
warning: cannot load object (7 0 R) into cache
error: invalid key in dict
warning: cannot load object (7 0 R) into cache
error: invalid key in dict
warning: cannot load object (7 0 R) into cache
error: invalid key in dict
warning: cannot load object (7 0 R) into cache
error: invalid key in dict
warning: cannot load object (7 0 R) into cache
error: invalid key in dict
warning: cannot load object (7 0 R) into cache
error: invalid key in dict
warning: cannot load object (7 0 R) into cache
error: invalid key in dict
warning: cannot load object (7 0 R) into cache
mutool: source/pdf/pdf-store.c:61: pdf_store_item: Assertion `pdf_is_name(ctx, key) || pdf_is_array(ctx, key) || pdf_is_dict(ctx, key) || pdf_is_indirect(ctx, key)' failed.
Aborted
Comment 1 Sebastian Rasmussen 2018-01-22 18:26:51 UTC
A tentative fix for this issue is in commit e90443e47298401052b7534868ca59d43c00a228.
Comment 2 Sebastian Rasmussen 2018-02-01 09:19:53 UTC
The tentative fix was redone and the final commit that fixes the issue is

commit 8a3257b01faa899dd9b5e35c6bb3403cd709c371
Author: Tor Andersson <tor.andersson@artifex.com>
Date:   Wed Jan 24 14:05:09 2018 +0100

    Fix 698886: Don't try to load non-stream XObjects.