[Poppler-bugs] [Bug 101385] New: Segfault on locked documents in c++ api

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Mon Jun 12 09:39:29 UTC 2017


https://bugs.freedesktop.org/show_bug.cgi?id=101385

            Bug ID: 101385
           Summary: Segfault on locked documents in c++ api
           Product: poppler
           Version: unspecified
          Hardware: Other
                OS: All
            Status: NEW
          Severity: major
          Priority: medium
         Component: cpp frontend
          Assignee: poppler-bugs at lists.freedesktop.org
          Reporter: jeroen.ooms at stat.ucla.edu

If the user enters an incorrect password when reading a protected pdf via
document::load_from_raw_data() a message 'Incorrect password' is printed,
however the function still returns a valid *document object.

This returned object has doc->is_locked() == true and several methods are still
available such as:

  doc->get_pdf_version()
  doc->info_date()
  doc->is_encrypted()
  doc->is_locked()

This is useful. What's not good is that calling any of the other methods will
cause a segfault. For example:

  doc->pages()
  doc->page_layout()
  doc->metadata()
  doc->create_pag()
  doc->fonts()

Calling any of these methods on a locked document should raise a c++ exception
(e.g. "error: pdf file is locked") rather than crashing.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/poppler-bugs/attachments/20170612/41e415fb/attachment-0001.html>


More information about the Poppler-bugs mailing list