<html>
<head>
<base href="https://bugs.freedesktop.org/">
</head>
<body><table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Bug ID</th>
<td><a class="bz_bug_link
bz_status_NEW "
title="NEW - Segfault on locked documents in c++ api"
href="https://bugs.freedesktop.org/show_bug.cgi?id=101385">101385</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>Segfault on locked documents in c++ api
</td>
</tr>
<tr>
<th>Product</th>
<td>poppler
</td>
</tr>
<tr>
<th>Version</th>
<td>unspecified
</td>
</tr>
<tr>
<th>Hardware</th>
<td>Other
</td>
</tr>
<tr>
<th>OS</th>
<td>All
</td>
</tr>
<tr>
<th>Status</th>
<td>NEW
</td>
</tr>
<tr>
<th>Severity</th>
<td>major
</td>
</tr>
<tr>
<th>Priority</th>
<td>medium
</td>
</tr>
<tr>
<th>Component</th>
<td>cpp frontend
</td>
</tr>
<tr>
<th>Assignee</th>
<td>poppler-bugs@lists.freedesktop.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>jeroen.ooms@stat.ucla.edu
</td>
</tr></table>
<p>
<div>
<pre>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.</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are the assignee for the bug.</li>
</ul>
</body>
</html>