|
|
76f8c5 |
From c909964bff671d5ff0d8eee5f613ded4562f8afd Mon Sep 17 00:00:00 2001
|
|
|
76f8c5 |
From: Albert Astals Cid <aacid@kde.org>
|
|
|
76f8c5 |
Date: Sat, 7 Mar 2015 14:54:43 +0100
|
|
|
76f8c5 |
Subject: Do not assert on broken document
|
|
|
76f8c5 |
|
|
|
76f8c5 |
Bug #89422
|
|
|
76f8c5 |
|
|
|
76f8c5 |
diff --git a/poppler/SecurityHandler.cc b/poppler/SecurityHandler.cc
|
|
|
76f8c5 |
index d6f5599..44bd8b8 100644
|
|
|
76f8c5 |
--- a/poppler/SecurityHandler.cc
|
|
|
76f8c5 |
+++ b/poppler/SecurityHandler.cc
|
|
|
76f8c5 |
@@ -288,12 +288,16 @@ StandardSecurityHandler::StandardSecurityHandler(PDFDoc *docA,
|
|
|
76f8c5 |
ok = gTrue;
|
|
|
76f8c5 |
} else if (encVersion == 5 && encRevision == 5) {
|
|
|
76f8c5 |
fileID = new GooString(); // unused for V=R=5
|
|
|
76f8c5 |
- ownerEnc = ownerEncObj.getString()->copy();
|
|
|
76f8c5 |
- userEnc = userEncObj.getString()->copy();
|
|
|
76f8c5 |
- if (fileKeyLength > 32 || fileKeyLength < 0) {
|
|
|
76f8c5 |
- fileKeyLength = 32;
|
|
|
76f8c5 |
+ if (ownerEncObj.isString() && userEncObj.isString()) {
|
|
|
76f8c5 |
+ ownerEnc = ownerEncObj.getString()->copy();
|
|
|
76f8c5 |
+ userEnc = userEncObj.getString()->copy();
|
|
|
76f8c5 |
+ if (fileKeyLength > 32 || fileKeyLength < 0) {
|
|
|
76f8c5 |
+ fileKeyLength = 32;
|
|
|
76f8c5 |
+ }
|
|
|
76f8c5 |
+ ok = gTrue;
|
|
|
76f8c5 |
+ } else {
|
|
|
76f8c5 |
+ error(errSyntaxError, -1, "Weird encryption owner/user info");
|
|
|
76f8c5 |
}
|
|
|
76f8c5 |
- ok = gTrue;
|
|
|
76f8c5 |
} else if (!(encVersion == -1 && encRevision == -1)) {
|
|
|
76f8c5 |
error(errUnimplemented, -1,
|
|
|
76f8c5 |
"Unsupported version/revision ({0:d}/{1:d}) of Standard security handler",
|
|
|
76f8c5 |
--
|
|
|
76f8c5 |
cgit v0.10.2
|
|
|
76f8c5 |
|