From a0a3bc3482e78a545e8f8290f7d35f42aa968814 Mon Sep 17 00:00:00 2001 From: ochang Date: Thu, 12 May 2016 15:22:48 -0700 Subject: Fix use of an uninitialised CFX_Widestring in AFNumber_Keystroke. BUG=611352 R=thestig@chromium.org Review-Url: https://codereview.chromium.org/1977613002 --- fpdfsdk/javascript/PublicMethods.cpp | 5 ++--- 1 file 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; -- cgit v1.2.3