diff options
author | imp <imp@FreeBSD.org> | 2003-04-20 03:34:59 +0000 |
---|---|---|
committer | imp <imp@FreeBSD.org> | 2003-04-20 03:34:59 +0000 |
commit | 826ccd96daa4f3f2def23325ff14eab70f645ee6 (patch) | |
tree | 969e36bfcb0cacfad3465db4d31bfc69c917dc6f /usr.sbin/raycontrol | |
parent | 1cc1eff16446363cd5a260a5d551505fa5692016 (diff) | |
download | FreeBSD-src-826ccd96daa4f3f2def23325ff14eab70f645ee6.zip FreeBSD-src-826ccd96daa4f3f2def23325ff14eab70f645ee6.tar.gz |
Don't dereference a NULL pointer when we don't have a ':' in the
optarg of the -W option. Instead, do the next best thing and give a
usage message.
Reported by: kris
Diffstat (limited to 'usr.sbin/raycontrol')
-rw-r--r-- | usr.sbin/raycontrol/raycontrol.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/usr.sbin/raycontrol/raycontrol.c b/usr.sbin/raycontrol/raycontrol.c index c287643..5f9d5c9 100644 --- a/usr.sbin/raycontrol/raycontrol.c +++ b/usr.sbin/raycontrol/raycontrol.c @@ -460,6 +460,8 @@ main(int argc, char *argv[]) stringp = optarg; ap = av; *ap = strsep(&stringp, ":"); + if (stringp == NULL) + usage(p); ap++; *ap = strsep(&stringp, ":"); mib = atoi(av[0]); |