Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(898)

Unified Diff: core/src/fpdfdoc/doc_formfield.cpp

Issue 478183002: Add a null check before getting unicode text in CPDF_FormField::GetValue (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: core/src/fpdfdoc/doc_formfield.cpp
diff --git a/core/src/fpdfdoc/doc_formfield.cpp b/core/src/fpdfdoc/doc_formfield.cpp
index eeba372390e348b928682674ef36286ff3b9ae34..a2f0fbd297e5f7f8c68824021238c8a1503ae2ef 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();
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698