Module Name:    src
Committed By:   bouyer
Date:           Tue Aug 18 10:58:33 UTC 2009

Modified Files:
        src/usr.bin/xlint/lint1 [netbsd-4-0]: init.c

Log Message:
Pull up following revision(s) (requested by msaitoh in ticket #1353):
        usr.bin/xlint/lint1/init.c: revision 1.22
pushinit(): fix a use-after-free bug.


To generate a diff of this commit:
cvs rdiff -u -r1.21 -r1.21.6.1 src/usr.bin/xlint/lint1/init.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.bin/xlint/lint1/init.c
diff -u src/usr.bin/xlint/lint1/init.c:1.21 src/usr.bin/xlint/lint1/init.c:1.21.6.1
--- src/usr.bin/xlint/lint1/init.c:1.21	Sun Oct 15 18:18:54 2006
+++ src/usr.bin/xlint/lint1/init.c	Tue Aug 18 10:58:33 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: init.c,v 1.21 2006/10/15 18:18:54 christos Exp $	*/
+/*	$NetBSD: init.c,v 1.21.6.1 2009/08/18 10:58:33 bouyer Exp $	*/
 
 /*
  * Copyright (c) 1994, 1995 Jochen Pohl
@@ -37,7 +37,7 @@
 
 #include <sys/cdefs.h>
 #if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: init.c,v 1.21 2006/10/15 18:18:54 christos Exp $");
+__RCSID("$NetBSD: init.c,v 1.21.6.1 2009/08/18 10:58:33 bouyer Exp $");
 #endif
 
 #include <stdlib.h>
@@ -247,7 +247,7 @@
 #ifdef DEBUG
 	char	buf[64];
 #endif
-	istk_t	*istk;
+	istk_t	*istk, *inxt;
 	int	cnt;
 	sym_t	*m;
 
@@ -369,8 +369,9 @@
 		if (namedmem) {
 			DPRINTF(("pushinit(): pop\n"));
 	pop:
+			inxt = initstk->i_nxt;
 			free(istk);
-			initstk = initstk->i_nxt;
+			initstk = inxt;
 			goto again;
 		}
 		istk->i_cnt = 1;

Reply via email to