summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorochang <ochang@chromium.org>2016-05-12 15:22:48 -0700
committerCommit bot <commit-bot@chromium.org>2016-05-12 15:22:48 -0700
commita0a3bc3482e78a545e8f8290f7d35f42aa968814 (patch)
treeca4c842b1861498b853b4f97994943068c594cc9
parent732f6a01f11749192badba3d5151a33460560b7f (diff)
downloadpdfium-a0a3bc3482e78a545e8f8290f7d35f42aa968814.tar.xz
Fix use of an uninitialised CFX_Widestring in AFNumber_Keystroke.
BUG=611352 R=thestig@chromium.org Review-Url: https://codereview.chromium.org/1977613002
-rw-r--r--fpdfsdk/javascript/PublicMethods.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/fpdfsdk/javascript/PublicMethods.cpp b/fpdfsdk/javascript/PublicMethods.cpp
index 2b14b772aa..fa7b5d4d36 100644
--- a/fpdfsdk/javascript/PublicMethods.cpp
+++ b/fpdfsdk/javascript/PublicMethods.cpp
@@ -903,11 +903,10 @@ FX_BOOL CJS_PublicMethods::AFNumber_Keystroke(
CFX_WideString wstrValue = val;
if (pEvent->WillCommit()) {
- CFX_WideString wstrValue = StrTrim(wstrValue);
- if (wstrValue.IsEmpty())
+ CFX_WideString swTemp = StrTrim(wstrValue);
+ if (swTemp.IsEmpty())
return TRUE;
- CFX_WideString swTemp = wstrValue;
swTemp.Replace(L",", L".");
if (!IsNumber(swTemp.c_str())) {
pEvent->Rc() = FALSE;