Created attachment 138926 [details] reproducer - null object instead of embedded file stream Hi, poppler crashes on a file with embedded file which has null object instead of embedded file stream or when even reference to a stream is missing. Originally reported here: https://bugzilla.redhat.com/show_bug.cgi?id=1569334 https://bugzilla.gnome.org/show_bug.cgi?id=795368 Related to: https://bugs.freedesktop.org/show_bug.cgi?id=10386
Created attachment 138927 [details] reproducer - missing reference to a embedded file stream
Created attachment 138928 [details] [review] Patch fixing this issue
Why are you adding the FileSpec.cc code? the EmbFile constructor already checks for the object being an stream and EmbFile has an isOk you should be using. I'd prefer not to change that since your change would actually most probably break the qt5 frontend code.
Created attachment 138946 [details] [review] Patch fixing this issue - modified (In reply to Albert Astals Cid from comment #3) > Why are you adding the FileSpec.cc code? the EmbFile constructor already > checks for the object being an stream and EmbFile has an isOk you should be > using. It is for the case when the referenced object is null object and not a stream. I've modified the patch so that the object is tested for being a stream in glib frontend and does not modify FileSpec.cc at all. Or we can alternatively fetch the object in constructor of FileSpec and check for being stream so that isOk() covers also this case. > I'd prefer not to change that since your change would actually most probably > break the qt5 frontend code.
Looking at EmbFile *FileSpec::getEmbeddedFile() it should never return null if you've checked for isOk before, maybe that's what it's missing? but i guess it's similar to what you're doing now. I'll let the glib/ experts comment :)
-- GitLab Migration Automatic Message -- This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity. You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/poppler/poppler/issues/236.
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.