From owner-svn-ports-all@freebsd.org Sat May 4 11:53:37 2019 Return-Path: Delivered-To: svn-ports-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2CBAE158B933; Sat, 4 May 2019 11:53:37 +0000 (UTC) (envelope-from tcberner@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C4E7A86AE9; Sat, 4 May 2019 11:53:36 +0000 (UTC) (envelope-from tcberner@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9A6EF7F5C; Sat, 4 May 2019 11:53:36 +0000 (UTC) (envelope-from tcberner@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x44BraRU056873; Sat, 4 May 2019 11:53:36 GMT (envelope-from tcberner@FreeBSD.org) Received: (from tcberner@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x44BraEJ056872; Sat, 4 May 2019 11:53:36 GMT (envelope-from tcberner@FreeBSD.org) Message-Id: <201905041153.x44BraEJ056872@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tcberner set sender to tcberner@FreeBSD.org using -f From: "Tobias C. Berner" Date: Sat, 4 May 2019 11:53:36 +0000 (UTC) To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r500806 - in head/textproc/ebook-tools: . files X-SVN-Group: ports-head X-SVN-Commit-Author: tcberner X-SVN-Commit-Paths: in head/textproc/ebook-tools: . files X-SVN-Commit-Revision: 500806 X-SVN-Commit-Repository: ports MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: C4E7A86AE9 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-0.977,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-ports-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the ports tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 May 2019 11:53:37 -0000 Author: tcberner Date: Sat May 4 11:53:35 2019 New Revision: 500806 URL: https://svnweb.freebsd.org/changeset/ports/500806 Log: textproc/ebook-tools: fix bug wit invalid epub files https://bugs.kde.org/show_bug.cgi?id=406116 Added: head/textproc/ebook-tools/files/patch-git_93ebf9 (contents, props changed) Modified: head/textproc/ebook-tools/Makefile Modified: head/textproc/ebook-tools/Makefile ============================================================================== --- head/textproc/ebook-tools/Makefile Sat May 4 11:43:14 2019 (r500805) +++ head/textproc/ebook-tools/Makefile Sat May 4 11:53:35 2019 (r500806) @@ -3,7 +3,7 @@ PORTNAME= ebook-tools PORTVERSION= 0.2.2 -PORTREVISION= 4 +PORTREVISION= 5 CATEGORIES= textproc kde MASTER_SITES= SF Added: head/textproc/ebook-tools/files/patch-git_93ebf9 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/textproc/ebook-tools/files/patch-git_93ebf9 Sat May 4 11:53:35 2019 (r500806) @@ -0,0 +1,59 @@ +Fix bug in libepub which may lead to crashes in baloo. + +[1] https://bugsfiles.kde.org/attachment.cgi?id=119785 +[2] https://sourceforge.net/projects/ebook-tools/ +[3] https://bugs.kde.org/show_bug.cgi?id=406116 +[4] https://sourceforge.net/p/ebook-tools/bugs/8/ + +From 93ebf942a90f9c95797838f9adab94bc0378671c Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Stefan=20Br=C3=BCns?= +Date: Tue, 30 Apr 2019 16:36:09 +0200 +Subject: [PATCH] Avoid crash on toc.ncx navPoint without navLabel + +Althoug at least one navLabel is required per navPoint, there is no +guarantee it actually exists. + +Avoid crashes due to invalid accesses of a null label in case the toc is +broken, and spew a warning. + +Fixes #8 epub_tit_next crashes on navPoint without navLabel. +--- + ebook-tools/src/libepub/epub.c | 5 +++-- + ebook-tools/src/libepub/opf.c | 4 ++++ + 2 files changed, 7 insertions(+), 2 deletions(-) + +diff --git ebook-tools/src/libepub/epub.c ebook-tools/src/libepub/epub.c +index d085503..a259d9d 100644 +--- src/libepub/epub.c ++++ src/libepub/epub.c +@@ -469,8 +469,9 @@ int epub_tit_next(struct titerator *tit) { + case TITERATOR_NAVMAP: + case TITERATOR_PAGES: + ti = GetNodeData(curr); +- tit->cache.label = +- (char *)_opf_label_get_by_doc_lang(tit->epub->opf, ti->label); ++ if (ti->label) ++ tit->cache.label = ++ (char *)_opf_label_get_by_doc_lang(tit->epub->opf, ti->label); + + if (! tit->cache.label) + tit->cache.label = (char *)ti->id; +diff --git ebook-tools/src/libepub/opf.c ebook-tools/src/libepub/opf.c +index 6851db2..09bce9e 100644 +--- src/libepub/opf.c ++++ src/libepub/opf.c +@@ -398,6 +398,10 @@ void _opf_parse_navmap(struct opf *opf, xmlTextReaderPtr reader) { + + } else if (xmlTextReaderNodeType(reader) == 15) { + if (item) { ++ if (! item->label) { ++ _epub_print_debug(opf->epub, DEBUG_WARNING, ++ "- missing navlabel for nav point element"); ++ } + _epub_print_debug(opf->epub, DEBUG_INFO, + "adding nav point item->%s %s (d:%d,p:%d)", + item->id, item->src, item->depth, item->playOrder); +-- +2.21.0 + +