summaryrefslogtreecommitdiff
path: root/basic
diff options
context:
space:
mode:
authorEike Rathke <erack@redhat.com>2013-03-21 19:30:36 +0100
committerEike Rathke <erack@redhat.com>2013-03-21 19:32:45 +0100
commitcaecf6102f5042908c915afe89834ab7d3a4a4cb (patch)
tree9bee61a527d07b06033be8223b033d2f145946de /basic
parentcd9c754828eb4f63373463399d7a41aa9ca43459 (diff)
SbiScanner::NextSym: check status after rtl_math_uStringToDouble()
For example, 10e308 is overflow, not 0 ... Change-Id: Ib7d622865bfb73581732bda45c76e078ee7d05d0
Diffstat (limited to 'basic')
-rw-r--r--basic/source/comp/scanner.cxx7
1 files changed, 5 insertions, 2 deletions
diff --git a/basic/source/comp/scanner.cxx b/basic/source/comp/scanner.cxx
index 5fbdcef097cf..728187ce0fda 100644
--- a/basic/source/comp/scanner.cxx
+++ b/basic/source/comp/scanner.cxx
@@ -361,8 +361,11 @@ bool SbiScanner::NextSym()
{ aError = OUString('.');
GenError( SbERR_BAD_CHAR_IN_NUMBER ); }
- // #57844 use localized function
- nVal = rtl_math_uStringToDouble( buf, buf+(p-buf), '.', ',', NULL, NULL );
+ rtl_math_ConversionStatus eStatus = rtl_math_ConversionStatus_Ok;
+ const sal_Unicode* pParseEnd = buf;
+ nVal = rtl_math_uStringToDouble( buf, buf+(p-buf), '.', ',', &eStatus, &pParseEnd );
+ if (eStatus != rtl_math_ConversionStatus_Ok || pParseEnd != buf+(p-buf))
+ GenError( SbERR_MATH_OVERFLOW );
ndig = ndig - comma;
if( !comma && !exp )