Reading this thread, I took a look at sal/rtl/source/strtmpl.cxx
969 static IMPL_RTL_STRINGDATA* IMPL_RTL_STRINGNAME( ImplAlloc )(
sal_Int32 nLen )
970 {
971 IMPL_RTL_STRINGDATA * pData
972 = (sal::static_int_cast< sal_uInt32 >(nLen)
973 <= ((SAL_MAX_UINT32 - sizeof (IMPL_RTL_STRINGDATA))
974 / sizeof (IMPL_RTL_STRCODE)))
975 ? (IMPL_RTL_STRINGDATA *) rtl_allocateMemory(
976 sizeof (IMPL_RTL_STRINGDATA) + nLen * sizeof
(IMPL_RTL_STRCODE))
977 : NULL;
978 if (pData != NULL) {
979 pData->refCount = 1;
980 pData->length = nLen;
981 pData->buffer[nLen] = 0;
982 }
983 return pData;
984 }
Since we cast "nLen" parameter in "sal_uInt32", could it help to add an
assert about nLen should be >= 0 ?
Privacy Policy |
Impressum (Legal Info) |
Copyright information: Unless otherwise specified, all text and images
on this website are licensed under the
Creative Commons Attribution-Share Alike 3.0 License.
This does not include the source code of LibreOffice, which is
licensed under the Mozilla Public License (
MPLv2).
"LibreOffice" and "The Document Foundation" are
registered trademarks of their corresponding registered owners or are
in actual use as trademarks in one or more countries. Their respective
logos and icons are also subject to international copyright laws. Use
thereof is explained in our
trademark policy.