From 75c65210c59de575f5a536f53bab9018b6edbed9 Mon Sep 17 00:00:00 2001 From: Ryan Harrison Date: Wed, 16 Aug 2017 13:52:15 -0400 Subject: Add in missting string length check BUG=chromium:754984 Change-Id: I106d460c80804797cee537d1990f901b5bf5a519 Reviewed-on: https://pdfium-review.googlesource.com/11171 Commit-Queue: Ryan Harrison Reviewed-by: Henrique Nakashima Reviewed-by: Tom Sepez --- fpdfsdk/javascript/PublicMethods.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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; -- cgit v1.2.3