Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/compat/linux/common Fix info leaks.
details: https://anonhg.NetBSD.org/src/rev/92b8921d18f4
branches: trunk
changeset: 964955:92b8921d18f4
user: maxv <maxv%NetBSD.org@localhost>
date: Fri Aug 23 13:36:45 2019 +0000
description:
Fix info leaks.
diffstat:
sys/compat/linux/common/linux_statfs.h | 8 +++++---
1 files changed, 5 insertions(+), 3 deletions(-)
diffs (43 lines):
diff -r f7e83ed5677a -r 92b8921d18f4 sys/compat/linux/common/linux_statfs.h
--- a/sys/compat/linux/common/linux_statfs.h Fri Aug 23 12:49:59 2019 +0000
+++ b/sys/compat/linux/common/linux_statfs.h Fri Aug 23 13:36:45 2019 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: linux_statfs.h,v 1.6 2012/09/13 13:59:33 pooka Exp $ */
+/* $NetBSD: linux_statfs.h,v 1.7 2019/08/23 13:36:45 maxv Exp $ */
/*-
* Copyright (c) 1995, 1998, 1999 The NetBSD Foundation, Inc.
@@ -48,6 +48,8 @@
{
int i;
+ memset(lsp, 0, sizeof(*lsp));
+
for (i = 0; i < linux_fstypes_cnt; i++) {
if (strcmp(bsp->f_fstypename, linux_fstypes[i].mty_bsd) == 0) {
lsp->l_ftype = linux_fstypes[i].mty_linux;
@@ -82,7 +84,6 @@
lsp->l_ffsid.val[0] = bsp->f_fsidx.__fsid_val[0];
lsp->l_ffsid.val[1] = bsp->f_fsidx.__fsid_val[1];
lsp->l_fnamelen = bsp->f_namemax;
- (void)memset(lsp->l_fspare, 0, sizeof(lsp->l_fspare));
}
/*
@@ -96,6 +97,8 @@
{
int i, div;
+ memset(lsp, 0, sizeof(*lsp));
+
for (i = 0; i < linux_fstypes_cnt; i++) {
if (strcmp(bsp->f_fstypename, linux_fstypes[i].mty_bsd) == 0) {
lsp->l_ftype = linux_fstypes[i].mty_linux;
@@ -121,7 +124,6 @@
lsp->l_ffsid.val[0] = bsp->f_fsidx.__fsid_val[0];
lsp->l_ffsid.val[1] = bsp->f_fsidx.__fsid_val[1];
lsp->l_fnamelen = bsp->f_namemax;
- (void)memset(lsp->l_fspare, 0, sizeof(lsp->l_fspare));
}
#endif /* !_LINUX_STATFS_H */
Home |
Main Index |
Thread Index |
Old Index