[Libreoffice-commits] core.git: vcl/unx

Caolán McNamara (via logerrit) logerrit at kemper.freedesktop.org
Thu Dec 10 20:41:14 UTC 2020


 vcl/unx/generic/printer/cupsmgr.cxx |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

New commits:
commit 605ee3213087b13782bfc0731762c175bc97e53f
Author:     Caolán McNamara <caolanm at redhat.com>
AuthorDate: Thu Dec 10 17:14:03 2020 +0000
Commit:     Caolán McNamara <caolanm at redhat.com>
CommitDate: Thu Dec 10 21:40:32 2020 +0100

    cupsGetPPD returned a nullptr which OString newly aborts with
    
    Change-Id: Ia42e9b501f3e5c769d9d151597e6384836369ed5
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107571
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/vcl/unx/generic/printer/cupsmgr.cxx b/vcl/unx/generic/printer/cupsmgr.cxx
index dbbb26666ba5..7830323d22d7 100644
--- a/vcl/unx/generic/printer/cupsmgr.cxx
+++ b/vcl/unx/generic/printer/cupsmgr.cxx
@@ -90,7 +90,8 @@ struct GetPPDAttribs
 #pragma GCC diagnostic push
 #pragma GCC diagnostic ignored "-Wdeprecated-declarations"
 #endif
-        OString aResult = cupsGetPPD(m_aParameter.getStr());
+        const char* pResult = cupsGetPPD(m_aParameter.getStr());
+        OString aResult = pResult ? OString(pResult) : OString();
 #ifdef __GNUC__
 #pragma GCC diagnostic pop
 #endif


More information about the Libreoffice-commits mailing list