summaryrefslogtreecommitdiff
path: root/fpdfsdk/src/javascript/Document.cpp
diff options
context:
space:
mode:
authorTom Sepez <tsepez@chromium.org>2015-04-01 09:49:59 -0700
committerTom Sepez <tsepez@chromium.org>2015-04-01 09:49:59 -0700
commita1b7af074f3a4e15a1254b6df0c82baa4b012ae0 (patch)
tree2cee0637364522a25eaf48fd1ca90e16bda701ac /fpdfsdk/src/javascript/Document.cpp
parent370d356d33aff3c38f306d820c7b340458c7bc14 (diff)
downloadpdfium-a1b7af074f3a4e15a1254b6df0c82baa4b012ae0.tar.xz
doc.external - Check direction of property access before blindly getting.
BUG=https://code.google.com/p/pdfium/issues/detail?id=137 R=thestig@chromium.org Review URL: https://codereview.chromium.org/1039063002
Diffstat (limited to 'fpdfsdk/src/javascript/Document.cpp')
-rw-r--r--fpdfsdk/src/javascript/Document.cpp13
1 files changed, 4 insertions, 9 deletions
diff --git a/fpdfsdk/src/javascript/Document.cpp b/fpdfsdk/src/javascript/Document.cpp
index f88d661beb..b1a2ad7688 100644
--- a/fpdfsdk/src/javascript/Document.cpp
+++ b/fpdfsdk/src/javascript/Document.cpp
@@ -1139,7 +1139,9 @@ FX_BOOL Document::numPages(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString&
FX_BOOL Document::external(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
{
//In Chrome case,should always return true.
- vp << TRUE;
+ if (vp.IsGetting()) {
+ vp << TRUE;
+ }
return TRUE;
}
@@ -1169,13 +1171,12 @@ FX_BOOL Document::baseURL(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString&
if (vp.IsGetting())
{
vp << m_cwBaseURL;
- return TRUE;
}
else
{
vp >> m_cwBaseURL;
- return TRUE;
}
+ return TRUE;
}
FX_BOOL Document::calculate(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
@@ -1302,11 +1303,6 @@ FX_BOOL Document::addLink(IFXJS_Context* cc, const CJS_Parameters& params, CJS_V
FX_BOOL Document::closeDoc(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
{
ASSERT(m_pDocument != NULL);
-
-
-
-
-
return TRUE;
}
@@ -1315,7 +1311,6 @@ FX_BOOL Document::getPageBox(IFXJS_Context* cc, const CJS_Parameters& params, CJ
return TRUE;
}
-
FX_BOOL Document::getAnnot(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
{
return TRUE;