Blame SOURCES/poppler-0.26.5-do-not-assert-broken-document.patch

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