summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorThordur I. Bjornsson <thib@cvs.openbsd.org>2009-06-02 05:20:42 +0000
committerThordur I. Bjornsson <thib@cvs.openbsd.org>2009-06-02 05:20:42 +0000
commit11c786eecede2d22f16dddc20bd27e60cb482c53 (patch)
tree163a5668883ba952500d8761f1ca535f5ad57db0 /sys
parentd9c40b3fe77354c6ccec0eef94f314a50cc875cd (diff)
set needfree to NULL in sys_writev() so stack garbage
does not cause us to call free if we never malloced. crash found by & OK marco@
Diffstat (limited to 'sys')
-rw-r--r--sys/kern/sys_generic.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/kern/sys_generic.c b/sys/kern/sys_generic.c
index ee0d4817970..9011e3be6e1 100644
--- a/sys/kern/sys_generic.c
+++ b/sys/kern/sys_generic.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sys_generic.c,v 1.62 2009/06/02 04:13:37 deraadt Exp $ */
+/* $OpenBSD: sys_generic.c,v 1.63 2009/06/02 05:20:41 thib Exp $ */
/* $NetBSD: sys_generic.c,v 1.24 1996/03/29 00:25:32 cgd Exp $ */
/*
@@ -262,7 +262,7 @@ sys_writev(struct proc *p, void *v, register_t *retval)
} */ *uap = v;
struct filedesc *fdp = p->p_fd;
struct file *fp;
- struct iovec *needfree;
+ struct iovec *needfree = NULL;
struct iovec *iov;
const struct iovec *iovp = SCARG(uap, iovp);
int fd = SCARG(uap, fd);