summaryrefslogtreecommitdiff
path: root/fpdfsdk/javascript/PublicMethods.cpp
diff options
context:
space:
mode:
authorRyan Harrison <rharrison@chromium.org>2017-08-16 13:52:15 -0400
committerChromium commit bot <commit-bot@chromium.org>2017-08-16 18:48:31 +0000
commit75c65210c59de575f5a536f53bab9018b6edbed9 (patch)
tree6072ac564723d2dbda968775c5230fcd95831a58 /fpdfsdk/javascript/PublicMethods.cpp
parentcd04b727f0b182f4ca39bb5b9198ba2f6389e05d (diff)
downloadpdfium-75c65210c59de575f5a536f53bab9018b6edbed9.tar.xz
Add in missting string length check
BUG=chromium:754984 Change-Id: I106d460c80804797cee537d1990f901b5bf5a519 Reviewed-on: https://pdfium-review.googlesource.com/11171 Commit-Queue: Ryan Harrison <rharrison@chromium.org> Reviewed-by: Henrique Nakashima <hnakashima@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
Diffstat (limited to 'fpdfsdk/javascript/PublicMethods.cpp')
-rw-r--r--fpdfsdk/javascript/PublicMethods.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/fpdfsdk/javascript/PublicMethods.cpp b/fpdfsdk/javascript/PublicMethods.cpp
index 2996316d79..09815413ad 100644
--- a/fpdfsdk/javascript/PublicMethods.cpp
+++ b/fpdfsdk/javascript/PublicMethods.cpp
@@ -1762,7 +1762,7 @@ bool CJS_PublicMethods::AFExtractNums(CJS_Runtime* pRuntime,
}
CFX_WideString str = params[0].ToCFXWideString(pRuntime);
- if (str[0] == L'.' || str[0] == L',')
+ if (str.GetLength() > 0 && (str[0] == L'.' || str[0] == L','))
str = L"0" + str;
CFX_WideString sPart;