diff options
author | Jun Fang <jun_fang@foxitsoftware.com> | 2014-08-18 11:30:19 -0700 |
---|---|---|
committer | Jun Fang <jun_fang@foxitsoftware.com> | 2014-08-18 11:30:19 -0700 |
commit | 91177a4d73be70344caab2a62f6610672165207f (patch) | |
tree | 7179197fe50b6d59ad2254da1f1360177e59a712 | |
parent | 4f38edb402226948b637b99de8a6a123bdef20c7 (diff) | |
download | pdfium-91177a4d73be70344caab2a62f6610672165207f.tar.xz |
Add a null check before getting unicode text in CPDF_FormField::GetValue
The test pdf file defines an invalid dictionary object with a NULL arrary
in the filed of "/V". It causes that a NULL object is returned when trying
to get the first element of this arrary. So it needs to check whether the
returned object is NULL.
BUG=395986
R=tsepez@chromium.org
Review URL: https://codereview.chromium.org/478183002
-rw-r--r-- | core/src/fpdfdoc/doc_formfield.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/core/src/fpdfdoc/doc_formfield.cpp b/core/src/fpdfdoc/doc_formfield.cpp index eeba372390..a2f0fbd297 100644 --- a/core/src/fpdfdoc/doc_formfield.cpp +++ b/core/src/fpdfdoc/doc_formfield.cpp @@ -324,7 +324,9 @@ CFX_WideString CPDF_FormField::GetValue(FX_BOOL bDefault) return pValue->GetUnicodeText(); case PDFOBJ_ARRAY: pValue = ((CPDF_Array*)pValue)->GetElementValue(0); - return pValue->GetUnicodeText(); + if (pValue) { + return pValue->GetUnicodeText(); + } break; } return CFX_WideString(); |