artulab
projects
/
openbsd
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
cbad1b8
)
Avoid NULL deref in fd_getfile_mode(); OK deraadt@
author
millert
<millert@openbsd.org>
Thu, 30 Apr 2015 21:18:45 +0000
(21:18 +0000)
committer
millert
<millert@openbsd.org>
Thu, 30 Apr 2015 21:18:45 +0000
(21:18 +0000)
sys/kern/kern_descrip.c
patch
|
blob
|
history
diff --git
a/sys/kern/kern_descrip.c
b/sys/kern/kern_descrip.c
index
2c8955c
..
93d6a9c
100644
(file)
--- a/
sys/kern/kern_descrip.c
+++ b/
sys/kern/kern_descrip.c
@@
-1,4
+1,4
@@
-/* $OpenBSD: kern_descrip.c,v 1.11
8 2015/04/30 09:20:51 mpi Exp $
*/
+/* $OpenBSD: kern_descrip.c,v 1.11
9 2015/04/30 21:18:45 millert Exp $
*/
/* $NetBSD: kern_descrip.c,v 1.42 1996/03/30 22:24:38 christos Exp $ */
/*
@@
-201,7
+201,7
@@
fd_getfile_mode(struct filedesc *fdp, int fd, int mode)
fp = fd_getfile(fdp, fd);
- if ((fp->f_flag & mode) == 0)
+ if (
fp == NULL ||
(fp->f_flag & mode) == 0)
return (NULL);
return (fp);