summaryrefslogtreecommitdiff
path: root/core/fpdfdoc
diff options
context:
space:
mode:
authorweili <weili@chromium.org>2016-12-07 11:32:52 -0800
committerCommit bot <commit-bot@chromium.org>2016-12-07 11:32:53 -0800
commitab5a20d9de8c801b8376bfe2d6f7cf9ac7d26028 (patch)
tree9b758e430d7bd5216c2801186ae24636c56897d5 /core/fpdfdoc
parent833619b4441915c7c55085d44b3221eaef0d9800 (diff)
downloadpdfium-ab5a20d9de8c801b8376bfe2d6f7cf9ac7d26028.tar.xz
Fix the way to check terminal field in interactive formchromium/2945
Originally the key "T" was checked which was not correct since that key is optional. Now change to check "FT" as well as its parent's key since this key is also inheritable. BUG=chromium:440132 Review-Url: https://codereview.chromium.org/2554223002
Diffstat (limited to 'core/fpdfdoc')
-rw-r--r--core/fpdfdoc/cpdf_interform.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/core/fpdfdoc/cpdf_interform.cpp b/core/fpdfdoc/cpdf_interform.cpp
index c323986603..e574e28fe5 100644
--- a/core/fpdfdoc/cpdf_interform.cpp
+++ b/core/fpdfdoc/cpdf_interform.cpp
@@ -1079,8 +1079,12 @@ void CPDF_InterForm::FixPageFields(const CPDF_Page* pPage) {
}
CPDF_FormField* CPDF_InterForm::AddTerminalField(CPDF_Dictionary* pFieldDict) {
- if (!pFieldDict->KeyExist("T"))
- return nullptr;
+ if (!pFieldDict->KeyExist("FT")) {
+ // Key "FT" is required for terminal fields, it is also inheritable.
+ CPDF_Dictionary* pParentDict = pFieldDict->GetDictFor("Parent");
+ if (!pParentDict || !pParentDict->KeyExist("FT"))
+ return nullptr;
+ }
CPDF_Dictionary* pDict = pFieldDict;
CFX_WideString csWName = FPDF_GetFullName(pFieldDict);