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

Unified Diff: fpdfsdk/src/jsapi/fxjs_v8.cpp

Issue 383563002: Fix an out-of-boundary issue for wide string (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Created 6 years, 5 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
« fpdfsdk/src/javascript/app.cpp ('K') | « fpdfsdk/src/javascript/app.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: fpdfsdk/src/jsapi/fxjs_v8.cpp
diff --git a/fpdfsdk/src/jsapi/fxjs_v8.cpp b/fpdfsdk/src/jsapi/fxjs_v8.cpp
index f2336ab2fc5ed68a4737a762904cf845a8e09f15..5eb9873f5ce5d73073f5548cead75805487be27f 100644
--- a/fpdfsdk/src/jsapi/fxjs_v8.cpp
+++ b/fpdfsdk/src/jsapi/fxjs_v8.cpp
@@ -734,7 +734,7 @@ CFX_WideString JS_ToString(v8::Handle<v8::Value> pValue)
{
if(pValue.IsEmpty()) return L"";
v8::String::Utf8Value s(pValue->ToString());
- return CFX_WideString::FromUTF8(*s);
+ return CFX_WideString::FromUTF8(*s, s.length());
palmer 2014/07/10 19:10:55 Ahh, I see, FromUTF8 has the same behavior. There
}
v8::Handle<v8::Array> JS_ToArray(v8::Handle<v8::Value> pValue)
« fpdfsdk/src/javascript/app.cpp ('K') | « fpdfsdk/src/javascript/app.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698