diff options
author | 2006-05-05 06:46:17 +0000 | |
---|---|---|
committer | 2006-05-05 06:46:17 +0000 | |
commit | 4cb0a8a37d9afa8d544cd8e6600a9dabcd78fae3 (patch) | |
tree | a1fee90bf19547927d5e56008564fc6d602c811d | |
parent | Ignore binaries which are not OpenBSD binaries (.note section), some cleanup (diff) | |
download | wireguard-openbsd-4cb0a8a37d9afa8d544cd8e6600a9dabcd78fae3.tar.xz wireguard-openbsd-4cb0a8a37d9afa8d544cd8e6600a9dabcd78fae3.zip |
Fix SEGV on scalar initialization with braces; also found in NetBSD
rev 1.23 as part of a much larger diff. ok cloder@
-rw-r--r-- | usr.bin/xlint/lint1/init.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/usr.bin/xlint/lint1/init.c b/usr.bin/xlint/lint1/init.c index 068c1d7d719..65d77f823c2 100644 --- a/usr.bin/xlint/lint1/init.c +++ b/usr.bin/xlint/lint1/init.c @@ -1,4 +1,4 @@ -/* $OpenBSD: init.c,v 1.8 2006/04/18 02:59:40 cloder Exp $ */ +/* $OpenBSD: init.c,v 1.9 2006/05/05 06:46:17 otto Exp $ */ /* $NetBSD: init.c,v 1.4 1995/10/02 17:21:37 jpo Exp $ */ /* @@ -33,7 +33,7 @@ */ #ifndef lint -static char rcsid[] = "$OpenBSD: init.c,v 1.8 2006/04/18 02:59:40 cloder Exp $"; +static char rcsid[] = "$OpenBSD: init.c,v 1.9 2006/05/05 06:46:17 otto Exp $"; #endif #include <stdlib.h> @@ -461,7 +461,7 @@ strginit(tnode_t *tn) * Check if we have an array type which can be initialized by * the string. */ - if (istk->i_subt->t_tspec == ARRAY) { + if (istk->i_subt != NULL && istk->i_subt->t_tspec == ARRAY) { t = istk->i_subt->t_subt->t_tspec; if (!((strg->st_tspec == CHAR && (t == CHAR || t == UCHAR || t == SCHAR)) || |