#761037 libepub-dev: Segfault on iterating over toc and possible memory leaks

Package:
libepub-dev
Source:
ebook-tools
Description:
library to work with the EPUB file format - development files
Submitter:
Boris Egorov
Date:
2023-04-13 20:57:04 UTC
Severity:
normal
#761037#5
Date:
2014-09-10 08:12:17 UTC
From:
To:
Dear Maintainer,

I scanned library with cppcheck and llvm's scan-build. It founds a few possible
memory leaks and NULL pointer dereference. I created a simple testcase which
triggers NULL pointer dereference and segfaults my program. Usage is quite
common: my example based on einfo tool.

I found that libepub website is abandoned and I didn't found any git/svn repos
for the project. So I've downloaded sources of library (0.2.2-4) with 'aptitude
source', added testcase to debian/tests and fixed NULL pointer dereference and
leaks. I'll attach changes (created by diff) to this bugreport along with scan-
build results.

#761037#10
Date:
2014-09-10 08:20:10 UTC
From:
To:
Sorry for too many similar epub.diff files in bureport, they are the
same. reportbug utility is kind of weird.

scan-build results attached to this email.

#761037#15
Date:
2023-04-13 20:40:14 UTC
From:
To:
Hi Boris,
  Are your bugs fixed by:
https://github.com/captn3m0/ebook-tools/commit/5079e63250cd2f04a0829b273623c15ecb7586c4

I noticed that patch from a few days ago, and that was by someone who
had run afl against it.

It seems to fix Okular epub bug:
https://bugs.kde.org/show_bug.cgi?id=466425

(I can't tell if these are actually security bugs or not, but havining
epub readers crash feels dodgy)

Dave