Kaydet (Commit) 2987f8d8 authored tarafından Caolán McNamara's avatar Caolán McNamara

coverity#1266493 Use of untrusted scalar value

Change-Id: Iba051da07f5ffafcab559fe03a4e93f21a2d4f8a
üst 90ec1a60
......@@ -567,7 +567,14 @@ static OUString read_unicode( SvPersistStream & rStm )
rtl_uString *pStr = NULL;
sal_uInt16 nL = 0;
rStm.ReadUInt16( nL );
if ( nL )
const size_t nMaxRecords = rStm.remainingSize() / sizeof(sal_Unicode);
if (nL > nMaxRecords)
{
SAL_WARN("editeng", "Parsing error: " << nMaxRecords <<
" max possible entries, but " << nL << " claimed, truncating");
nL = nMaxRecords;
}
if (nL)
{
pStr = rtl_uString_alloc(nL);
//endian specific?, yipes!
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment