diff options
author | roam <roam@FreeBSD.org> | 2001-08-24 15:49:30 +0000 |
---|---|---|
committer | roam <roam@FreeBSD.org> | 2001-08-24 15:49:30 +0000 |
commit | 81537f200cec45188932d15acb91ead617498007 (patch) | |
tree | 963b306bed0d7c8fad380ac496b75d7e4fefaa53 /sys/kern/kern_sig.c | |
parent | 5053d4fa277dcc006a6585503be3d7d201b7ef6d (diff) | |
download | FreeBSD-src-81537f200cec45188932d15acb91ead617498007.zip FreeBSD-src-81537f200cec45188932d15acb91ead617498007.tar.gz |
Prevent passing a null pointer as a filename to vn_open(),
if for some reason expand_name() failed to build a core file name.
PR: 29931
Submitted by: Foldi Tamas <crow@kapu.hu>
Reviewed by: dd, -arch
MFC after: 1 month
Diffstat (limited to 'sys/kern/kern_sig.c')
-rw-r--r-- | sys/kern/kern_sig.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/sys/kern/kern_sig.c b/sys/kern/kern_sig.c index 0ab24e6..6fcea78 100644 --- a/sys/kern/kern_sig.c +++ b/sys/kern/kern_sig.c @@ -1793,6 +1793,8 @@ coredump(p) restart: name = expand_name(p->p_comm, p->p_ucred->cr_uid, p->p_pid); + if (name == NULL) + return (EINVAL); NDINIT(&nd, LOOKUP, NOFOLLOW, UIO_SYSSPACE, name, p); flags = O_CREAT | FWRITE | O_NOFOLLOW; error = vn_open(&nd, &flags, S_IRUSR | S_IWUSR); |