Kaydet (Commit) 0578353a authored tarafından Mike Kaganski's avatar Mike Kaganski

tdf#120703 PVS: dereference before nullptr check

V595 The 'ustrFile' pointer was utilized before it was verified against nullptr.
     Check lines: 83, 107.

Change-Id: I874983508fb805b1f0a55b3a5b6d4d78ae1babdb
Reviewed-on: https://gerrit.libreoffice.org/71472
Tested-by: Jenkins
Reviewed-by: 's avatarMike Kaganski <mike.kaganski@collabora.com>
üst 5cb3a6da
......@@ -19,6 +19,7 @@
#include <osl/file.h>
#include <rtl/ustring.h>
#include <cassert>
static sal_uInt32 osl_defCalcTextWidth( rtl_uString *ustrText )
{
......@@ -49,6 +50,8 @@ oslFileError SAL_CALL osl_abbreviateSystemPath( rtl_uString *ustrSystemPath, rtl
}
}
assert(ustrPath && ustrFile);
uPathWidth = pfnCalcWidth( ustrPath );
uFileWidth = pfnCalcWidth( ustrFile );
......@@ -101,11 +104,8 @@ oslFileError SAL_CALL osl_abbreviateSystemPath( rtl_uString *ustrSystemPath, rtl
uPathWidth = pfnCalcWidth( *pustrCompacted );
}
if ( ustrPath )
rtl_uString_release( ustrPath );
if ( ustrFile )
rtl_uString_release( ustrFile );
rtl_uString_release(ustrPath);
rtl_uString_release(ustrFile);
return osl_File_E_None;
}
......
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