summaryrefslogtreecommitdiff
path: root/sal
diff options
context:
space:
mode:
authorMike Kaganski <mike.kaganski@collabora.com>2021-10-01 15:12:49 +0200
committerMike Kaganski <mike.kaganski@collabora.com>2021-10-01 18:04:02 +0200
commit0471dccf9c81b4851078033d286a215954c488ed (patch)
tree63c3950dd0e2a60b853fa23aacdacf6e5d464e1c /sal
parentb7a425d48cb282e20059e78ad5216da833dec803 (diff)
Calculate buffer size correctly
A mistake in eae24a9488814e77254d175c11fc4a138c1dbd30 Change-Id: I0da64366e4c39b3f5559e8a1c757a94d811f041f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122869 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'sal')
-rw-r--r--sal/rtl/math.cxx2
1 files changed, 1 insertions, 1 deletions
diff --git a/sal/rtl/math.cxx b/sal/rtl/math.cxx
index ce939b907655..2d1c1257ef97 100644
--- a/sal/rtl/math.cxx
+++ b/sal/rtl/math.cxx
@@ -506,7 +506,7 @@ void doubleToString(typename T::String ** pResult,
// max(nDigits) = max(nDecPlaces) + 1 + max(nExp) + 1 = 20 + 1 + 308 + 1 = 330
// max(nBuf) = max(nDigits) + max(nDecPlaces) + 10 + max(nDigits) * 2 = 330 * 3 + 20 + 10 = 1020
assert(nBuf <= 1024);
- typename T::Char* pBuf = static_cast<typename T::Char*>(alloca(nBuf));
+ typename T::Char* pBuf = static_cast<typename T::Char*>(alloca(nBuf * sizeof(typename T::Char)));
typename T::Char * p = pBuf;
if ( bSign )
*p++ = '-';