[poppler] goo/GooString.cc

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Fri Oct 22 15:49:45 UTC 2021


 goo/GooString.cc |   11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

New commits:
commit 757b566fc14b3d9e33b50387afe9dced709006b2
Author: Albert Astals Cid <aacid at kde.org>
Date:   Fri Oct 22 17:38:17 2021 +0200

    Don't crash if the GooString * is null

diff --git a/goo/GooString.cc b/goo/GooString.cc
index 2f8aa985..54e8bc52 100644
--- a/goo/GooString.cc
+++ b/goo/GooString.cc
@@ -18,7 +18,7 @@
 // Copyright (C) 2006 Kristian Høgsberg <krh at redhat.com>
 // Copyright (C) 2006 Krzysztof Kowalczyk <kkowalczyk at gmail.com>
 // Copyright (C) 2007 Jeff Muizelaar <jeff at infidigm.net>
-// Copyright (C) 2008-2011, 2016-2018 Albert Astals Cid <aacid at kde.org>
+// Copyright (C) 2008-2011, 2016-2018, 2021 Albert Astals Cid <aacid at kde.org>
 // Copyright (C) 2011 Kenji Uno <ku at digitaldolphins.jp>
 // Copyright (C) 2012, 2013 Fabio D'Urso <fabiodurso at hotmail.it>
 // Copyright (C) 2012, 2017 Adrian Johnson <ajohnson at redneon.com>
@@ -418,8 +418,13 @@ GooString *GooString::appendfv(const char *fmt, va_list argList)
                     reverseAlign = !reverseAlign;
                     break;
                 case fmtGooString:
-                    str = arg.gs->c_str();
-                    len = arg.gs->getLength();
+                    if (arg.gs) {
+                        str = arg.gs->c_str();
+                        len = arg.gs->getLength();
+                    } else {
+                        str = "(null)";
+                        len = 6;
+                    }
                     reverseAlign = !reverseAlign;
                     break;
                 case fmtSpace:


More information about the poppler mailing list