From 82c730bf83c7582d360fc4080c7729115b0a9550 Mon Sep 17 00:00:00 2001 From: Tom Sepez Date: Tue, 12 Jun 2018 13:39:16 +0000 Subject: Make empty document always have empty privileges This landed earlier as part of a larger change that got reverted for unrelated reasons. Now re-land it by itself. See https://pdfium-review.googlesource.com/c/pdfium/+/33370 If we don't have a document, then we can't dynamically tell if it is an XFA doc, so there's no reason to believe it should have all permissions. If there is an XFA doc under the covers, then the extension will give us the value. Change-Id: I6e007ab659914c39d2e5f3fe7a25d9d13439d358 Reviewed-on: https://pdfium-review.googlesource.com/34932 Commit-Queue: dsinclair Reviewed-by: dsinclair --- fpdfsdk/fpdf_view.cpp | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/fpdfsdk/fpdf_view.cpp b/fpdfsdk/fpdf_view.cpp index 535f1e5036..cbbfd9c71d 100644 --- a/fpdfsdk/fpdf_view.cpp +++ b/fpdfsdk/fpdf_view.cpp @@ -308,16 +308,7 @@ FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FPDF_GetFileVersion(FPDF_DOCUMENT doc, FPDF_EXPORT unsigned long FPDF_CALLCONV FPDF_GetDocPermissions(FPDF_DOCUMENT document) { CPDF_Document* pDoc = CPDFDocumentFromFPDFDocument(document); - // https://bugs.chromium.org/p/pdfium/issues/detail?id=499 - if (!pDoc) { -#ifndef PDF_ENABLE_XFA - return 0; -#else // PDF_ENABLE_XFA - return 0xFFFFFFFF; -#endif // PDF_ENABLE_XFA - } - - return pDoc->GetUserPermissions(); + return pDoc ? pDoc->GetUserPermissions() : 0; } FPDF_EXPORT int FPDF_CALLCONV -- cgit v1.2.3