Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/kern extattr(9): Fix uninitialized uio_iovcnt.



details:   https://anonhg.NetBSD.org/src/rev/c663183ddce9
branches:  trunk
changeset: 372012:c663183ddce9
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Tue Oct 25 23:22:17 2022 +0000

description:
extattr(9): Fix uninitialized uio_iovcnt.

diffstat:

 sys/kern/vfs_xattr.c |  6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diffs (34 lines):

diff -r 891650348fca -r c663183ddce9 sys/kern/vfs_xattr.c
--- a/sys/kern/vfs_xattr.c      Tue Oct 25 23:21:33 2022 +0000
+++ b/sys/kern/vfs_xattr.c      Tue Oct 25 23:22:17 2022 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: vfs_xattr.c,v 1.36 2021/06/27 09:13:08 christos Exp $  */
+/*     $NetBSD: vfs_xattr.c,v 1.37 2022/10/25 23:22:17 riastradh Exp $ */
 
 /*-
  * Copyright (c) 2005, 2008 The NetBSD Foundation, Inc.
@@ -68,7 +68,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: vfs_xattr.c,v 1.36 2021/06/27 09:13:08 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vfs_xattr.c,v 1.37 2022/10/25 23:22:17 riastradh Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -303,6 +303,7 @@
                aiov.iov_base = data;
                aiov.iov_len = nbytes;
                auio.uio_iov = &aiov;
+               auio.uio_iovcnt = 1;
                auio.uio_offset = 0;
                if (nbytes > INT_MAX) {
                        error = EINVAL;
@@ -383,6 +384,7 @@
                aiov.iov_base = data;
                aiov.iov_len = nbytes;
                auio.uio_iov = &aiov;
+               auio.uio_iovcnt = 1;
                auio.uio_offset = 0;
                if (nbytes > INT_MAX) {
                        error = EINVAL;



Home | Main Index | Thread Index | Old Index