summaryrefslogtreecommitdiffstats
path: root/contrib/bmake
diff options
context:
space:
mode:
authorsjg <sjg@FreeBSD.org>2013-11-14 00:29:48 +0000
committersjg <sjg@FreeBSD.org>2013-11-14 00:29:48 +0000
commit962f1bc0eefc130f7ba3abb009e17d1da2e85987 (patch)
tree3a9d606bbd5a0f6e8dd5a6e6407ba6e5856c1161 /contrib/bmake
parent09420c2c42ff9a59aeacea63aa26bfbf68ef8c05 (diff)
downloadFreeBSD-src-962f1bc0eefc130f7ba3abb009e17d1da2e85987.zip
FreeBSD-src-962f1bc0eefc130f7ba3abb009e17d1da2e85987.tar.gz
Don't SEGV when Hash_Table is uninitialized
Diffstat (limited to 'contrib/bmake')
-rw-r--r--contrib/bmake/hash.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/contrib/bmake/hash.c b/contrib/bmake/hash.c
index a22e2f2..216f284 100644
--- a/contrib/bmake/hash.c
+++ b/contrib/bmake/hash.c
@@ -221,6 +221,9 @@ Hash_FindEntry(Hash_Table *t, const char *key)
unsigned h;
const char *p;
+ if (t == NULL || t->bucketPtr == NULL) {
+ return NULL;
+ }
for (h = 0, p = key; *p;)
h = (h << 5) - h + *p++;
p = key;
OpenPOWER on IntegriCloud