Kaydet (Commit) 78587a7e authored tarafından Mark Wielaard's avatar Mark Wielaard Kaydeden (comit) Michael Stahl

Robustify PropItem::Read.

Initialize nType and nItemSize variables in case stream is faulty.

Change-Id: I59602f2b04e3816d8de7cc1a5e7e526c8e822477
Reviewed-on: https://gerrit.libreoffice.org/4762Reviewed-by: 's avatarMichael Stahl <mstahl@redhat.com>
Tested-by: 's avatarMichael Stahl <mstahl@redhat.com>
üst fb1931f9
...@@ -82,10 +82,14 @@ sal_Bool PropItem::Read( OUString& rString, sal_uInt32 nStringType, sal_Bool bAl ...@@ -82,10 +82,14 @@ sal_Bool PropItem::Read( OUString& rString, sal_uInt32 nStringType, sal_Bool bAl
nItemPos = Tell(); nItemPos = Tell();
if ( nStringType == VT_EMPTY ) if ( nStringType == VT_EMPTY )
{
nType = VT_NULL; // Initialize in case stream fails.
*this >> nType; *this >> nType;
}
else else
nType = nStringType & VT_TYPEMASK; nType = nStringType & VT_TYPEMASK;
nItemSize = 0; // Initialize in case stream fails.
*this >> nItemSize; *this >> nItemSize;
switch( nType ) switch( nType )
......
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