[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.0' - shell/source

Mike Kaganski (via logerrit) logerrit at kemper.freedesktop.org
Wed May 15 08:26:12 UTC 2019


 shell/source/win32/spsupp/COMOpenDocuments.cxx |    6 ++++++
 1 file changed, 6 insertions(+)

New commits:
commit 5621fc1aa647ca6188524f24d6ca6b9a6ca7f822
Author:     Mike Kaganski <mike.kaganski at collabora.com>
AuthorDate: Wed May 15 08:59:01 2019 +0200
Commit:     Mike Kaganski <mike.kaganski at collabora.com>
CommitDate: Wed May 15 10:25:21 2019 +0200

    Check passed pointers
    
    Change-Id: Idf5e77e4122ad4b5b91f25c50fdaaf25e34a76ae
    Reviewed-on: https://gerrit.libreoffice.org/72336
    Tested-by: Jenkins
    Reviewed-by: Mike Kaganski <mike.kaganski at collabora.com>
    (cherry picked from commit bb62eff4b4202ac85f3366d21fb1cbef52958b6d)
    Reviewed-on: https://gerrit.libreoffice.org/72342
    Tested-by: Mike Kaganski <mike.kaganski at collabora.com>

diff --git a/shell/source/win32/spsupp/COMOpenDocuments.cxx b/shell/source/win32/spsupp/COMOpenDocuments.cxx
index 93f6a17aaa8b..65c676af89c3 100644
--- a/shell/source/win32/spsupp/COMOpenDocuments.cxx
+++ b/shell/source/win32/spsupp/COMOpenDocuments.cxx
@@ -314,6 +314,8 @@ STDMETHODIMP COMOpenDocuments::CreateNewDocument2(
     BSTR /*bstrDefaultSaveLocation*/, // A string that contains the path that specifies a suggested default location for saving the new document
     VARIANT_BOOL* pbResult)           // true if the document creation succeeds; otherwise false
 {
+    if (!pbResult)
+        return E_POINTER;
     // TODO: resolve the program from varProgID (nullptr -> default?)
     HRESULT hr = LOStart(L"-n", bstrTemplateLocation, m_aObjectSafety.GetSafe_forUntrustedCaller() || m_aObjectSafety.GetSafe_forUntrustedData());
     *pbResult = toVBool(SUCCEEDED(hr));
@@ -365,6 +367,8 @@ STDMETHODIMP COMOpenDocuments::ViewDocument3(
     VARIANT /*varProgID*/,     // An optional string that contains the ProgID of the application with which to open the document. If this argument is omitted, the default viewer for the document is used
     VARIANT_BOOL *pbResult)    // true if the document was successfully opened; otherwise false
 {
+    if (!pbResult)
+        return E_POINTER;
     // TODO: resolve the program from varProgID (nullptr -> default?)
     HRESULT hr = LOStart(L"--view", bstrDocumentLocation, m_aObjectSafety.GetSafe_forUntrustedCaller() || m_aObjectSafety.GetSafe_forUntrustedData());
     *pbResult = toVBool(SUCCEEDED(hr));
@@ -427,6 +431,8 @@ STDMETHODIMP COMOpenDocuments::EditDocument3(
     VARIANT /*varProgID*/,          // An optional string that contains the ProgID of the application with which to edit the document. If this argument is omitted, the default editor for the document is used
     VARIANT_BOOL *pbResult)     // true if the document was successfully opened; otherwise false
 {
+    if (!pbResult)
+        return E_POINTER;
     // TODO: resolve the program from varProgID (nullptr -> default?)
     HRESULT hr = LOStart(L"-o", bstrDocumentLocation, m_aObjectSafety.GetSafe_forUntrustedCaller() || m_aObjectSafety.GetSafe_forUntrustedData());
     *pbResult = toVBool(SUCCEEDED(hr));


More information about the Libreoffice-commits mailing list