From 292b49f544d1c7a1c073e07af27e3a628c90959a Mon Sep 17 00:00:00 2001 From: errt Date: Mon, 14 Oct 2019 19:49:28 +0200 Subject: Fix segfault on empty navMap --- backend/epub/epub-document.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/backend/epub/epub-document.c b/backend/epub/epub-document.c index b3a048e2..552a18d3 100644 --- a/backend/epub/epub-document.c +++ b/backend/epub/epub-document.c @@ -1256,7 +1256,7 @@ setup_document_index(EpubDocument *epub_document,gchar *containeruri) xmlNodePtr navPoint = xmlretval; - do { + while(navPoint != NULL) { if ( !xmlStrcmp(navPoint->name,(xmlChar*)"navPoint")) { xmlretval = NULL; @@ -1304,7 +1304,7 @@ setup_document_index(EpubDocument *epub_document,gchar *containeruri) navPoint = navPoint->next; - } while(navPoint != NULL); + } xml_free_doc(); -- cgit v1.2.1