Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/usr.sbin/pkg_install/admin Never access argv[i+1] before you...
details: https://anonhg.NetBSD.org/src/rev/f0bf31c3151c
branches: trunk
changeset: 574774:f0bf31c3151c
user: rillig <rillig%NetBSD.org@localhost>
date: Fri Mar 11 22:52:04 2005 +0000
description:
Never access argv[i+1] before you know that argv[i] != NULL. Approved
by wiz.
diffstat:
usr.sbin/pkg_install/admin/main.c | 12 ++++++------
1 files changed, 6 insertions(+), 6 deletions(-)
diffs (32 lines):
diff -r 7cb208b58255 -r f0bf31c3151c usr.sbin/pkg_install/admin/main.c
--- a/usr.sbin/pkg_install/admin/main.c Fri Mar 11 22:29:16 2005 +0000
+++ b/usr.sbin/pkg_install/admin/main.c Fri Mar 11 22:52:04 2005 +0000
@@ -1,8 +1,8 @@
-/* $NetBSD: main.c,v 1.47 2004/12/29 11:34:59 agc Exp $ */
+/* $NetBSD: main.c,v 1.48 2005/03/11 22:52:04 rillig Exp $ */
#include <sys/cdefs.h>
#ifndef lint
-__RCSID("$NetBSD: main.c,v 1.47 2004/12/29 11:34:59 agc Exp $");
+__RCSID("$NetBSD: main.c,v 1.48 2005/03/11 22:52:04 rillig Exp $");
#endif
/*
@@ -487,13 +487,13 @@
argv++; /* "pmatch" */
+ if (argv[0] == NULL || argv[1] == NULL) {
+ usage(prog);
+ }
+
pattern = argv[0];
pkg = argv[1];
- if (pattern == NULL || pkg == NULL) {
- usage(prog);
- }
-
if (pmatch(pattern, pkg)){
return 0;
} else {
Home |
Main Index |
Thread Index |
Old Index