diff options
author | Norbert Thiebaud <nthiebaud@gmail.com> | 2014-09-11 18:44:37 +0200 |
---|---|---|
committer | Norbert Thiebaud <nthiebaud@gmail.com> | 2014-09-12 01:45:29 +0200 |
commit | 0439f66742b3b71e2a36c79a09e0943e51a37bde (patch) | |
tree | cc634402877037a69466a7de6b03950f9fc4b72d /xmlscript | |
parent | ucb: prevent out of bound access in OUString (diff) | |
download | core-0439f66742b3b71e2a36c79a09e0943e51a37bde.tar.gz core-0439f66742b3b71e2a36c79a09e0943e51a37bde.zip |
xmlscript: avoid accessing [0] of an emptry string
Change-Id: I2ad756b07418d3eb93f48374cd7de3bc3db9ce29
Diffstat (limited to 'xmlscript')
-rw-r--r-- | xmlscript/source/xmldlg_imexp/xmldlg_impmodels.cxx | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/xmlscript/source/xmldlg_imexp/xmldlg_impmodels.cxx b/xmlscript/source/xmldlg_imexp/xmldlg_impmodels.cxx index af40e4d51d65..3aed2223ef43 100644 --- a/xmlscript/source/xmldlg_imexp/xmldlg_impmodels.cxx +++ b/xmlscript/source/xmldlg_imexp/xmldlg_impmodels.cxx @@ -1064,7 +1064,11 @@ void TextFieldElement::endElement() if (getStringAttr( &aValue, "echochar", _xAttributes, _pImport->XMLNS_DIALOGS_UID ) && !aValue.isEmpty() ) { SAL_WARN_IF( aValue.getLength() != 1, "xmlscript.xmldlg", "### more than one character given for echochar!" ); - sal_Int16 nChar = (sal_Int16)aValue[ 0 ]; + sal_Int16 nChar = 0; + if(!aValue.isEmpty()) + { + nChar = (sal_Int16)aValue[ 0 ]; + } xControlModel->setPropertyValue( "EchoChar", makeAny( nChar ) ); } |