Package: libepub0
Version: 0.2.1-2
Severity: normal
Tags: patch

Dear Maintainer,
   * What led up to the situation?

I accidentally opened a empty epub file in okular, like one created with
zip foo.epub /tmp

   * What was the outcome of this action?

A segmentation fault in libepub

   * What outcome did you expect instead?
 
A error about invalid epub file


/Sune


-- System Information:
Debian Release: wheezy/sid
  APT prefers unstable
  APT policy: (500, 'unstable'), (500, 'testing'), (1, 'experimental')
Architecture: i386 (i686)

Kernel: Linux 3.1.0-1-686-pae (SMP w/4 CPU cores)
Locale: LANG=en_DK.ISO-8859-15, LC_CTYPE=en_DK.ISO-8859-15 (charmap=ISO-8859-15)
Shell: /bin/sh linked to /bin/dash

Versions of packages libepub0 depends on:
ii  libc6    2.13-22
ii  libxml2  2.7.8.dfsg-5
ii  libzip1  0.9.3-1

libepub0 recommends no packages.

libepub0 suggests no packages.

-- no debconf information
Description: Fix a segfault due to not cehcking for negative return values
Author: Sune Vuorela <s...@vuorela.dk>
Origin: Vendor

--- ebook-tools-0.2.1.orig/src/libepub/ocf.c
+++ ebook-tools-0.2.1/src/libepub/ocf.c
@@ -27,7 +27,7 @@ int _ocf_parse_container(struct ocf *ocf
 
   char *containerXml = NULL;
   const char *name = CONTAINER_FILENAME;
-  if (! _ocf_get_file(ocf, METAINFO_DIR "/" CONTAINER_FILENAME, &containerXml))
+  if (_ocf_get_file(ocf, METAINFO_DIR "/" CONTAINER_FILENAME, &containerXml) <= 0)
     return 0;
   
   xmlTextReaderPtr reader;

Reply via email to