diff options
author | roberto <roberto@FreeBSD.org> | 1999-11-18 23:04:38 +0000 |
---|---|---|
committer | roberto <roberto@FreeBSD.org> | 1999-11-18 23:04:38 +0000 |
commit | e5e1ccbdfe3abe9f1463c8a607b4c25dbb981c30 (patch) | |
tree | ac78ecc179a0eeddcd3a94594dae46c531b7fead /usr.sbin | |
parent | 2c6f9966930a37f986e5c981987955a13009c77f (diff) | |
download | FreeBSD-src-e5e1ccbdfe3abe9f1463c8a607b4c25dbb981c30.zip FreeBSD-src-e5e1ccbdfe3abe9f1463c8a607b4c25dbb981c30.tar.gz |
Stop run() from dereferencing a NULL pointer when you enter a valid command
then a ^D at the prompt.
cdcontrol> play 1 14
cdcontrol>
zsh: 40874 segmentation fault (core dumped) /usr/sbin/cdcontrol -f /dev/cd1c
Diffstat (limited to 'usr.sbin')
-rw-r--r-- | usr.sbin/cdcontrol/cdcontrol.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/usr.sbin/cdcontrol/cdcontrol.c b/usr.sbin/cdcontrol/cdcontrol.c index 4e124c9..7fad22e 100644 --- a/usr.sbin/cdcontrol/cdcontrol.c +++ b/usr.sbin/cdcontrol/cdcontrol.c @@ -242,6 +242,8 @@ int run (int cmd, char *arg) { int l, r, rc; + if (arg == NULL) + return 0; switch (cmd) { case CMD_QUIT: |