diff options
author | Chad Loder <cloder@cvs.openbsd.org> | 2006-04-21 02:38:37 +0000 |
---|---|---|
committer | Chad Loder <cloder@cvs.openbsd.org> | 2006-04-21 02:38:37 +0000 |
commit | e07f9da56b15bec1ecadafba81b077bdd7cb37f5 (patch) | |
tree | 7dd3432e274215b1156bccec5662d0e75d0e4755 /usr.bin/xlint | |
parent | 8aa8f27587cc7987ea6331ca32bb3123463f7f57 (diff) |
Fix crash when lint deals with break statements outside switch or loop.
This defect was introduced by me on my last commit and found by dlg@
when linting in kernel.
Diffstat (limited to 'usr.bin/xlint')
-rw-r--r-- | usr.bin/xlint/lint1/func.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/usr.bin/xlint/lint1/func.c b/usr.bin/xlint/lint1/func.c index d909c51f6d1..f0ac16a59cb 100644 --- a/usr.bin/xlint/lint1/func.c +++ b/usr.bin/xlint/lint1/func.c @@ -1,4 +1,4 @@ -/* $OpenBSD: func.c,v 1.14 2006/04/20 16:29:48 cloder Exp $ */ +/* $OpenBSD: func.c,v 1.15 2006/04/21 02:38:36 cloder Exp $ */ /* $NetBSD: func.c,v 1.7 1995/10/02 17:31:40 jpo Exp $ */ /* @@ -33,7 +33,7 @@ */ #ifndef lint -static char rcsid[] = "$OpenBSD: func.c,v 1.14 2006/04/20 16:29:48 cloder Exp $"; +static char rcsid[] = "$OpenBSD: func.c,v 1.15 2006/04/21 02:38:36 cloder Exp $"; #endif #include <stdlib.h> @@ -952,7 +952,7 @@ dobreak(void) * // etc... * } */ - if (bflag && !ci->c_switch) + if (bflag && (ci == NULL || !ci->c_switch)) chkreach(); reached = rchflg = 0; |