[Libreoffice-commits] core.git: 3 commits - sd/source ucb/source vcl/unx

Caolán McNamara (via logerrit) logerrit at kemper.freedesktop.org
Thu Jul 18 22:03:32 UTC 2019


 sd/source/ui/remotecontrol/ImagePreparer.cxx |    9 ++++++---
 ucb/source/ucp/file/filtask.cxx              |    2 +-
 vcl/unx/generic/fontmanager/fontmanager.cxx  |   10 ++++++----
 3 files changed, 13 insertions(+), 8 deletions(-)

New commits:
commit 1dc747590bb5fbd06411efc53589f3702cc992be
Author:     Caolán McNamara <caolanm at redhat.com>
AuthorDate: Thu Jul 18 10:56:39 2019 +0100
Commit:     Caolán McNamara <caolanm at redhat.com>
CommitDate: Fri Jul 19 00:02:08 2019 +0200

    cid#1448426 Unchecked return value
    
    Change-Id: Ia6ad812f76d1f69eb91a7d4f65f221b6598ce05a
    Reviewed-on: https://gerrit.libreoffice.org/75887
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/ucb/source/ucp/file/filtask.cxx b/ucb/source/ucp/file/filtask.cxx
index dd19b6edc7c3..9601bb0cb088 100644
--- a/ucb/source/ucp/file/filtask.cxx
+++ b/ucb/source/ucp/file/filtask.cxx
@@ -2501,7 +2501,7 @@ TaskManager::getv(
         // Assume failure
         aIsRegular = false;
         osl::DirectoryItem aTargetItem;
-        osl::DirectoryItem::get( aFileStatus.getLinkTargetURL(), aTargetItem );
+        (void)osl::DirectoryItem::get( aFileStatus.getLinkTargetURL(), aTargetItem );
         if ( aTargetItem.is() )
         {
             osl::FileStatus aTargetStatus( osl_FileStatus_Mask_Type );
commit b6f91112daae40fcde357f2eb3f12df08702af76
Author:     Caolán McNamara <caolanm at redhat.com>
AuthorDate: Thu Jul 18 10:59:22 2019 +0100
Commit:     Caolán McNamara <caolanm at redhat.com>
CommitDate: Fri Jul 19 00:01:45 2019 +0200

    cid#1448435 Unchecked return value
    
    Change-Id: I1c75280dfcfa1f475d657570bf390847ab922cc8
    Reviewed-on: https://gerrit.libreoffice.org/75889
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/vcl/unx/generic/fontmanager/fontmanager.cxx b/vcl/unx/generic/fontmanager/fontmanager.cxx
index 3438fb7cd73e..8af7d1a53b67 100644
--- a/vcl/unx/generic/fontmanager/fontmanager.cxx
+++ b/vcl/unx/generic/fontmanager/fontmanager.cxx
@@ -236,10 +236,12 @@ std::vector<std::unique_ptr<PrintFontManager::PrintFont>> PrintFontManager::anal
                 if (aFile.open(osl_File_OpenFlag_Read | osl_File_OpenFlag_NoLock) == osl::File::E_None)
                 {
                     osl::DirectoryItem aItem;
-                    osl::DirectoryItem::get( aURL, aItem );
-                    osl::FileStatus aFileStatus( osl_FileStatus_Mask_FileSize );
-                    aItem.getFileStatus( aFileStatus );
-                    fileSize = aFileStatus.getFileSize();
+                    if (osl::DirectoryItem::get(aURL, aItem) == osl::File::E_None)
+                    {
+                        osl::FileStatus aFileStatus( osl_FileStatus_Mask_FileSize );
+                        aItem.getFileStatus( aFileStatus );
+                        fileSize = aFileStatus.getFileSize();
+                    }
                 }
             }
 
commit 56fc428da3fd778a12e89ce789105dfbfbb28647
Author:     Caolán McNamara <caolanm at redhat.com>
AuthorDate: Thu Jul 18 11:02:21 2019 +0100
Commit:     Caolán McNamara <caolanm at redhat.com>
CommitDate: Fri Jul 19 00:01:26 2019 +0200

    cid#1448436 Unchecked return value
    
    Change-Id: I971587c6340afc83ac3a28b148650a8f20120164
    Reviewed-on: https://gerrit.libreoffice.org/75890
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/sd/source/ui/remotecontrol/ImagePreparer.cxx b/sd/source/ui/remotecontrol/ImagePreparer.cxx
index 3a208fdde6ec..baf117ac4b7a 100644
--- a/sd/source/ui/remotecontrol/ImagePreparer.cxx
+++ b/sd/source/ui/remotecontrol/ImagePreparer.cxx
@@ -155,16 +155,19 @@ uno::Sequence<sal_Int8> ImagePreparer::preparePreview(
 
     xFilter->filter( aProps );
 
-    // FIXME: error handling.
+    File aFile(aFileURL);
+    if (aFile.open(0) != osl::File::E_None)
+        return uno::Sequence<sal_Int8>();
 
-    File aFile( aFileURL );
-    aFile.open(0);
     sal_uInt64 aRead;
     rSize = 0;
     aFile.getSize( rSize );
     uno::Sequence<sal_Int8> aContents( rSize );
 
     aFile.read( aContents.getArray(), rSize, aRead );
+    if (aRead != rSize)
+        aContents.realloc(aRead);
+
     aFile.close();
     File::remove( aFileURL );
     return aContents;


More information about the Libreoffice-commits mailing list