diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2013-01-16 17:19:10 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2013-01-16 17:27:00 +0100 |
commit | 588997f0ebc5696574680098b128e66eff54f00c (patch) | |
tree | 6db38d6d18730e51fa44fc7e4f5532061f1c04d8 /sal | |
parent | 6059652fba10c0c03b8270c75cc53d6f60ce86c4 (diff) |
fdo#58415: Don't ignore osl_getFileURLFromSystemPath failure
...in osl_getFileStatus et al, it would leave the relevant status string member
unchanged (i.e., a null pointer) but would mark it as valid, so that later code
to retrieve the allegedly valid string member would crash upon the null pointer.
Change-Id: Ia8528f5dc27d94f3d14a2c416955a041b87863d3
Diffstat (limited to 'sal')
-rw-r--r-- | sal/osl/w32/file_dirvol.cxx | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/sal/osl/w32/file_dirvol.cxx b/sal/osl/w32/file_dirvol.cxx index 484bc1b2f393..89d286b50c3d 100644 --- a/sal/osl/w32/file_dirvol.cxx +++ b/sal/osl/w32/file_dirvol.cxx @@ -1515,8 +1515,10 @@ oslFileError SAL_CALL osl_getVolumeInformation( if (uFieldMask & osl_VolumeInfo_Mask_DeviceHandle) { + error = osl_getFileURLFromSystemPath(volume_root.pData, (rtl_uString**)&pInfo->pDeviceHandle); + if (error != osl_File_E_None) + return error; pInfo->uValidFields |= osl_VolumeInfo_Mask_DeviceHandle; - osl_getFileURLFromSystemPath(volume_root.pData, (rtl_uString**)&pInfo->pDeviceHandle); } return osl_File_E_None; @@ -1612,8 +1614,10 @@ static oslFileError SAL_CALL osl_getDriveInfo( rtl_uString *ustrSystemPath = NULL; rtl_uString_newFromStr( &ustrSystemPath, reinterpret_cast<const sal_Unicode*>(pItemImpl->cDriveString) ); - osl_getFileURLFromSystemPath( ustrSystemPath, &pStatus->ustrFileURL ); + oslFileError error = osl_getFileURLFromSystemPath( ustrSystemPath, &pStatus->ustrFileURL ); rtl_uString_release( ustrSystemPath ); + if (error != osl_File_E_None) + return error; pStatus->uValidFields |= osl_FileStatus_Mask_FileURL; } return osl_File_E_None; @@ -1641,7 +1645,9 @@ static oslFileError SAL_CALL osl_getServerInfo( if ( uFieldMask & osl_FileStatus_Mask_FileURL ) { - osl_getFileURLFromSystemPath( pItemImpl->m_pFullPath, &pStatus->ustrFileURL ); + oslFileError error = osl_getFileURLFromSystemPath( pItemImpl->m_pFullPath, &pStatus->ustrFileURL ); + if (error != osl_File_E_None) + return error; pStatus->uValidFields |= osl_FileStatus_Mask_FileURL; } return osl_File_E_None; @@ -1730,7 +1736,9 @@ oslFileError SAL_CALL osl_getFileStatus( if ( uFieldMask & osl_FileStatus_Mask_LinkTargetURL ) { - osl_getFileURLFromSystemPath( pItemImpl->m_pFullPath, &pStatus->ustrLinkTargetURL ); + oslFileError error = osl_getFileURLFromSystemPath( pItemImpl->m_pFullPath, &pStatus->ustrLinkTargetURL ); + if (error != osl_File_E_None) + return error; pStatus->uValidFields |= osl_FileStatus_Mask_LinkTargetURL; } @@ -1752,7 +1760,9 @@ oslFileError SAL_CALL osl_getFileStatus( } } - osl_getFileURLFromSystemPath( pItemImpl->m_pFullPath, &pStatus->ustrFileURL ); + oslFileError error = osl_getFileURLFromSystemPath( pItemImpl->m_pFullPath, &pStatus->ustrFileURL ); + if (error != osl_File_E_None) + return error; pStatus->uValidFields |= osl_FileStatus_Mask_FileURL; } |