You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openoffice.apache.org by ar...@apache.org on 2021/10/19 18:25:32 UTC
[openoffice] 02/02: All scripts must be subject to checks
This is an automated email from the ASF dual-hosted git repository.
ardovm pushed a commit to branch macros
in repository https://gitbox.apache.org/repos/asf/openoffice.git
commit 516d4738bb02f4ce3b35f119bfd06ea7a6161cf2
Author: Arrigo Marchiori <ar...@yahoo.it>
AuthorDate: Tue Oct 19 20:24:17 2021 +0200
All scripts must be subject to checks
---
main/scripting/source/protocolhandler/scripthandler.cxx | 8 +++-----
1 file changed, 3 insertions(+), 5 deletions(-)
diff --git a/main/scripting/source/protocolhandler/scripthandler.cxx b/main/scripting/source/protocolhandler/scripthandler.cxx
index d064fde..85643ee 100644
--- a/main/scripting/source/protocolhandler/scripthandler.cxx
+++ b/main/scripting/source/protocolhandler/scripthandler.cxx
@@ -166,11 +166,9 @@ void SAL_CALL ScriptProtocolHandler::dispatchWithNotification(
::rtl::OUString sLocation = xScriptUri->getParameter( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "location" ) ) );
bool bIsDocumentScript = ( sLocation == ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "document" ) ) );
- if ( bIsDocumentScript )
- {
- // obtain the component for our security check
- Reference< XEmbeddedScripts > xDocumentScripts;
- if ( getScriptInvocation() )
+ // obtain the component for our security check. We could check bIsDocumentScript but the "location" could be forged
+ if ( getScriptInvocation() ) {
+ Reference< XEmbeddedScripts > xDocumentScripts;
xDocumentScripts.set( m_xScriptInvocation->getScriptContainer(), UNO_SET_THROW );
OSL_ENSURE( xDocumentScripts.is(), "ScriptProtocolHandler::dispatchWithNotification: can't do the security check!" );