diff options
author | Tom Sepez <tsepez@chromium.org> | 2015-08-31 14:44:21 -0700 |
---|---|---|
committer | Tom Sepez <tsepez@chromium.org> | 2015-08-31 14:44:21 -0700 |
commit | 6e369c2ebb4769a42736b32154c0de12b73df45d (patch) | |
tree | 60bde53605565d86478d3d4c3c51ae58f180640c /fpdfsdk/src/javascript | |
parent | 7858c0aae5ee449dafe23c0e1aa0c164ae2889eb (diff) | |
download | pdfium-6e369c2ebb4769a42736b32154c0de12b73df45d.tar.xz |
Fix two issues shown by bug 489995
- Handle NULL in buffer operator<< under JS mailForm() calls.
- Ensure correct type in JS addIcon() calls.
BUG=489995
R=brucedawson@chromium.org, thestig@chromium.org
Review URL: https://codereview.chromium.org/1327473002 .
Diffstat (limited to 'fpdfsdk/src/javascript')
-rw-r--r-- | fpdfsdk/src/javascript/Document.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/fpdfsdk/src/javascript/Document.cpp b/fpdfsdk/src/javascript/Document.cpp index a8797095d8..91805b825e 100644 --- a/fpdfsdk/src/javascript/Document.cpp +++ b/fpdfsdk/src/javascript/Document.cpp @@ -1367,8 +1367,12 @@ FX_BOOL Document::addIcon(IFXJS_Context* cc, sError = JSGetStringFromID(pContext, IDS_STRING_JSPARAMERROR); return FALSE; } - CFX_WideString swIconName = params[0].ToCFXWideString(); + + if (params[1].GetType() != VT_object) { + sError = JSGetStringFromID(pContext, IDS_STRING_JSTYPEERROR); + return FALSE; + } JSFXObject pJSIcon = params[1].ToV8Object(); CJS_Runtime* pRuntime = pContext->GetJSRuntime(); |