basic/source/comp/symtbl.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
New commits: commit 7b122710e8d0fad1fbd4d65b48f6bead09213a2c Author: Mike Kaganski <[email protected]> AuthorDate: Tue Mar 24 16:13:49 2020 +0300 Commit: Mike Kaganski <[email protected]> CommitDate: Tue Mar 24 18:06:23 2020 +0100 Initialize buffer Also assert that correct data type is passed to SbiStringPool::Add. Change-Id: I774d983be82d702b31de1054d13661e1d0e9c1dd Reviewed-on: https://gerrit.libreoffice.org/c/core/+/90983 Tested-by: Jenkins Reviewed-by: Mike Kaganski <[email protected]> diff --git a/basic/source/comp/symtbl.cxx b/basic/source/comp/symtbl.cxx index ac6f1ecd29da..8385a31a3fdd 100644 --- a/basic/source/comp/symtbl.cxx +++ b/basic/source/comp/symtbl.cxx @@ -63,7 +63,7 @@ short SbiStringPool::Add( const OUString& rVal ) short SbiStringPool::Add( double n, SbxDataType t ) { - char buf[ 40 ]; + char buf[40]{}; switch( t ) { // tdf#131296 - store numeric value including its type character @@ -73,7 +73,7 @@ short SbiStringPool::Add( double n, SbxDataType t ) case SbxSINGLE: snprintf( buf, sizeof(buf), "%.6g!", static_cast<float>(n) ); break; case SbxDOUBLE: snprintf( buf, sizeof(buf), "%.16g", n ); break; // default processing in SbiRuntime::StepLOADNC - no type character case SbxCURRENCY: snprintf(buf, sizeof(buf), "%.16g@", n); break; - default: break; + default: assert(false); break; // should not happen } return Add( OUString::createFromAscii( buf ) ); } _______________________________________________ Libreoffice-commits mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
