diff options
author | Tor Andersson <tor.andersson@artifex.com> | 2015-05-05 20:21:18 +0200 |
---|---|---|
committer | Tor Andersson <tor.andersson@artifex.com> | 2015-05-05 20:55:53 +0200 |
commit | 2b3bd1b7dbbf13f82b70587676809f189354c77a (patch) | |
tree | 22b96944ac5affe33f317df1baff7d3a96eb079a /source | |
parent | 7a04cf3e3a23cff52214e2045e93ef44066d5de5 (diff) | |
download | mupdf-2b3bd1b7dbbf13f82b70587676809f189354c77a.tar.xz |
epub: Bail if rights.xml or encryption.xml are present (not DRM-free EPUB).
Diffstat (limited to 'source')
-rw-r--r-- | source/html/epub-doc.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/source/html/epub-doc.c b/source/html/epub-doc.c index e77770ac..b7b24c42 100644 --- a/source/html/epub-doc.c +++ b/source/html/epub-doc.c @@ -203,6 +203,11 @@ epub_parse_header(fz_context *ctx, epub_document *doc) char ncx[2048], s[2048]; epub_chapter *head, *tail; + if (fz_has_archive_entry(ctx, zip, "META-INF/rights.xml")) + fz_throw(ctx, FZ_ERROR_GENERIC, "EPUB is locked by DRM"); + if (fz_has_archive_entry(ctx, zip, "META-INF/encryption.xml")) + fz_throw(ctx, FZ_ERROR_GENERIC, "EPUB is locked by DRM"); + /* parse META-INF/container.xml to find OPF */ buf = fz_read_archive_entry(ctx, zip, "META-INF/container.xml"); |