diff options
author | Bo Xu <bo_xu@foxitsoftware.com> | 2014-11-14 14:18:05 -0800 |
---|---|---|
committer | Bo Xu <bo_xu@foxitsoftware.com> | 2014-11-14 14:18:05 -0800 |
commit | d66fda28dc2159ffc68c312764172382825c4d10 (patch) | |
tree | 0334cca0c937697f4dc61865eff750fcc3f1ffe9 /fpdfsdk/src/javascript/JS_Runtime.cpp | |
parent | 56ba90c35c31c77be3f3249fcf2ecf26f6efc62f (diff) | |
download | pdfium-d66fda28dc2159ffc68c312764172382825c4d10.tar.xz |
Change from 'this' to L'this' and remove the cast that was hiding this mismatch.
Found by VC++'s /analyze. Warning was:
fpdfsdk\src\javascript\js_runtime.cpp(352) : warning C6276:
Cast between semantically different string types: char * to wchar_t *.
Use of invalid string can lead to undefined behavior.
This mismatch has been there as far back as the history goes (to May of this year).
It looks like a real bug to me. However I don't know the implications of this bug and why it would not have been noticed at run-time.
The code has been this way as far back as the git history goes, but that is only to May 2014.
Original patch from Bruce Dawson(brucedawson@chromium.org)
BUG=427616
R=bo_xu@foxitsoftware.com
Review URL: https://codereview.chromium.org/705503004
Diffstat (limited to 'fpdfsdk/src/javascript/JS_Runtime.cpp')
-rw-r--r-- | fpdfsdk/src/javascript/JS_Runtime.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/fpdfsdk/src/javascript/JS_Runtime.cpp b/fpdfsdk/src/javascript/JS_Runtime.cpp index d7802b572e..b0af094bb1 100644 --- a/fpdfsdk/src/javascript/JS_Runtime.cpp +++ b/fpdfsdk/src/javascript/JS_Runtime.cpp @@ -349,7 +349,7 @@ void CJS_Runtime::GetObjectNames(CFX_WideStringArray& array) array.Add(CJS_Zoomtype::m_pClassName); array.Add(CJS_App::m_pClassName); - array.Add((FX_LPCWSTR)"this"); + array.Add(L"this"); array.Add(CJS_Event::m_pClassName); array.Add(CJS_Global::m_pClassName); |