Skip to content

Commit aa3bcfa

Browse files
gpooraveit65
authored andcommitted
libview: Check number of pages on ev_view_document_changed_cb
Fix crash on corrupted PDF with no pages. Thanks to Juha Kylmänen from OUSPG who were testing robutness. (CVE-2013-3718). libview: Fix warning on ev_view_document_changed_cb There was an introduction of a warning when fixing the bug https://bugzilla.gnome.org/show_bug.cgi?id=701302 If ev_view_document_changed_cb () is emitted when there is no previous document, the check fails. This patch change the order of the condition checks. origin commits: https://git.gnome.org/browse/evince/commit/?h=gnome-3-8&id=62b1585 https://git.gnome.org/browse/evince/commit/?h=gnome-3-8&id=5431595
1 parent 6346384 commit aa3bcfa

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

‎libview/ev-view.c‎

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6769,12 +6769,15 @@ ev_view_document_changed_cb (EvDocumentModel *model,
67696769
g_object_unref (view->document);
67706770
}
67716771

6772-
view->document = document;
6772+
view->document = document ? g_object_ref (document) : NULL;
67736773
view->find_result = 0;
67746774

67756775
if (view->document) {
6776+
if (ev_document_get_n_pages (view->document) <= 0 ||
6777+
!ev_document_check_dimensions (view->document))
6778+
return;
6779+
67766780
ev_view_set_loading (view, FALSE);
6777-
g_object_ref (view->document);
67786781
setup_caches (view);
67796782
}
67806783

0 commit comments

Comments
 (0)