Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/usr.bin/make/lst.lib Don't SEGV when passed NULL for list.
details: https://anonhg.NetBSD.org/src/rev/cde06ab721ed
branches: trunk
changeset: 791343:cde06ab721ed
user: sjg <sjg%NetBSD.org@localhost>
date: Thu Nov 14 00:01:28 2013 +0000
description:
Don't SEGV when passed NULL for list.
diffstat:
usr.bin/make/lst.lib/lstMember.c | 9 ++++++---
1 files changed, 6 insertions(+), 3 deletions(-)
diffs (36 lines):
diff -r 9a056c43c021 -r cde06ab721ed usr.bin/make/lst.lib/lstMember.c
--- a/usr.bin/make/lst.lib/lstMember.c Wed Nov 13 23:58:51 2013 +0000
+++ b/usr.bin/make/lst.lib/lstMember.c Thu Nov 14 00:01:28 2013 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: lstMember.c,v 1.13 2009/01/23 21:26:30 dsl Exp $ */
+/* $NetBSD: lstMember.c,v 1.14 2013/11/14 00:01:28 sjg Exp $ */
/*
* Copyright (c) 1988, 1989, 1990, 1993
@@ -33,14 +33,14 @@
*/
#ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: lstMember.c,v 1.13 2009/01/23 21:26:30 dsl Exp $";
+static char rcsid[] = "$NetBSD: lstMember.c,v 1.14 2013/11/14 00:01:28 sjg Exp $";
#else
#include <sys/cdefs.h>
#ifndef lint
#if 0
static char sccsid[] = "@(#)lstMember.c 8.1 (Berkeley) 6/6/93";
#else
-__RCSID("$NetBSD: lstMember.c,v 1.13 2009/01/23 21:26:30 dsl Exp $");
+__RCSID("$NetBSD: lstMember.c,v 1.14 2013/11/14 00:01:28 sjg Exp $");
#endif
#endif /* not lint */
#endif
@@ -58,6 +58,9 @@
List list = l;
ListNode lNode;
+ if (list == NULL) {
+ return NULL;
+ }
lNode = list->firstPtr;
if (lNode == NULL) {
return NULL;
Home |
Main Index |
Thread Index |
Old Index