From d483c054ce2f582a82f05f600f62b4b6d4cb24ac Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Henrik=20Grubbstr=C3=B6m=20=28Grubba=29?=
 <grubba@grubba.org>
Date: Wed, 24 Feb 2016 16:05:32 +0100
Subject: [PATCH] Compiler: Fixed potential NULL-deref.

Fixes [CID 742541] and [CID 742542].
---
 src/pike_types.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/src/pike_types.c b/src/pike_types.c
index 3089192291..6ba33268b7 100644
--- a/src/pike_types.c
+++ b/src/pike_types.c
@@ -2822,7 +2822,13 @@ static int lower_or_pike_types(struct pike_type *t1,
     }
   }
   if (!elem_on_stack) {
-    push_finished_type(t);
+    if (t) {
+      push_finished_type(t);
+    } else {
+      push_type(T_ZERO);
+    }
+  } else if (!t) {
+    /* No need to do anything. */
   } else if ((top = peek_type_stack())->type != t->type) {
     if (zero_implied && (top->type == T_ZERO)) {
       Pike_compiler->type_stackp--;
-- 
GitLab