diff options
author | greid <greid@FreeBSD.org> | 2002-04-15 15:49:30 +0000 |
---|---|---|
committer | greid <greid@FreeBSD.org> | 2002-04-15 15:49:30 +0000 |
commit | 5486a1c99e83e46d84c69055664f7be76949b884 (patch) | |
tree | f16d7c51bc2a2a6445d3841d56a626ead18c3388 /bin | |
parent | d44a434afa9bef4610bf21cc0e98424982cbb84b (diff) | |
download | FreeBSD-src-5486a1c99e83e46d84c69055664f7be76949b884.zip FreeBSD-src-5486a1c99e83e46d84c69055664f7be76949b884.tar.gz |
Stop a null pointer dereference in the builtin hash function.
PR: 36141
Approved by: cracauer
MFC after: 1 week
Diffstat (limited to 'bin')
-rw-r--r-- | bin/sh/exec.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/bin/sh/exec.c b/bin/sh/exec.c index e4948fe..718ef82 100644 --- a/bin/sh/exec.c +++ b/bin/sh/exec.c @@ -350,7 +350,10 @@ hashcmd(int argc __unused, char **argv __unused) if (verbose) { if (entry.cmdtype != CMDUNKNOWN) { /* if no error msg */ cmdp = cmdlookup(name, 0); - printentry(cmdp, verbose); + if (cmdp != NULL) + printentry(cmdp, verbose); + else + outfmt(&errout, "%s: not found\n", name); } flushall(); } |