[poppler] goo/GooHash.cc
Albert Astals Cid
aacid at kemper.freedesktop.org
Mon Jun 19 21:45:45 UTC 2017
goo/GooHash.cc | 18 ++++++++++++++++++
1 file changed, 18 insertions(+)
New commits:
commit 998db6c48ea07daecbb101cc5a13a44cd2563ecb
Author: Albert Astals Cid <aacid at kde.org>
Date: Mon Jun 19 23:45:24 2017 +0200
Fix crash on broken documents
Bug #101505
diff --git a/goo/GooHash.cc b/goo/GooHash.cc
index f4a92f17..49f58c5f 100644
--- a/goo/GooHash.cc
+++ b/goo/GooHash.cc
@@ -6,6 +6,20 @@
//
//========================================================================
+//========================================================================
+//
+// Modified under the Poppler project - http://poppler.freedesktop.org
+//
+// All changes made under the Poppler project to this file are licensed
+// under GPL version 2 or later
+//
+// Copyright (C) 2017 Albert Astals Cid <aacid at kde.org>
+//
+// To see a description of the changes please see the Changelog file that
+// came with your tarball or type make ChangeLog if you are building from git
+//
+//========================================================================
+
#include <config.h>
#ifdef USE_GCC_PRAGMAS
@@ -15,6 +29,7 @@
#include "gmem.h"
#include "GooString.h"
#include "GooHash.h"
+#include "GooLikely.h"
//------------------------------------------------------------------------
@@ -339,6 +354,9 @@ void GooHash::expand() {
GooHashBucket *GooHash::find(GooString *key, int *h) {
GooHashBucket *p;
+ if (unlikely(!key))
+ return nullptr;
+
*h = hash(key);
for (p = tab[*h]; p; p = p->next) {
if (!p->key->cmp(key)) {
More information about the poppler
mailing list