diff options
-rw-r--r-- | sal/rtl/strtmpl.cxx | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/sal/rtl/strtmpl.cxx b/sal/rtl/strtmpl.cxx index 3ab7698877ad..60712731e186 100644 --- a/sal/rtl/strtmpl.cxx +++ b/sal/rtl/strtmpl.cxx @@ -1503,6 +1503,11 @@ void SAL_CALL IMPL_RTL_STRINGNAME( newConcat )( IMPL_RTL_STRINGDATA** ppThis, *ppThis = pRight; IMPL_RTL_ACQUIRE( pRight ); } + else if (pLeft->length + > std::numeric_limits<sal_Int32>::max() - pRight->length) + { + *ppThis = nullptr; + } else { IMPL_RTL_STRINGDATA* pTempStr = IMPL_RTL_STRINGNAME( ImplAlloc )( pLeft->length + pRight->length ); |