lkml.org 
[lkml]   [2003]   [Jul]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: PATCH: fix 2 byte data leak due to padding
Alan Cox wrote:

>diff -u --new-file --recursive --exclude-from /usr/src/exclude linux-2.6.0-test2/fs/stat.c linux-2.6.0-test2-ac1/fs/stat.c
>--- linux-2.6.0-test2/fs/stat.c 2003-07-14 14:11:56.000000000 +0100
>+++ linux-2.6.0-test2-ac1/fs/stat.c 2003-07-23 16:27:42.000000000 +0100
>@@ -106,7 +106,7 @@
> {
> static int warncount = 5;
> struct __old_kernel_stat tmp;
>-
>+
> if (warncount > 0) {
> warncount--;
> printk(KERN_WARNING "VFS: Warning: %s using old stat() call. Recompile your binary.\n",
>@@ -116,6 +116,7 @@
> warncount = 0;
> }
>
>+ memset(&tmp, 0, sizeof(struct __old_kernel_stat));
>
Wouldn't it be more clear (better) to use sizeof(tmp) here rather than
sizeof(struct _old_kernel_stat)?

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:47    [W:0.197 / U:0.076 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site