public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* Re: fs/ufs/inode.c:817: warning: array subscript is above array bounds
@ 2007-01-31 20:10 Tomasz Kvarsin
  2007-01-31 21:24 ` Andrew Morton
  2007-01-31 21:27 ` Randy Dunlap
  0 siblings, 2 replies; 5+ messages in thread
From: Tomasz Kvarsin @ 2007-01-31 20:10 UTC (permalink / raw)
  To: Andrew Morton, dcb314; +Cc: linux-kernel

d binderman wrote:
>Hello there,
>
>I just tried to compile Linux kernel 2.6.19.2 with the
>new GNU C compiler version 4.3 snapshot 20070126.
>
>The compiler said
>
>fs/ufs/inode.c:817: warning: array subscript is above array bounds
>
>The source code is
>
>        for (i = 0; i < (UFS_NDADDR + UFS_NINDIR); i++)
>            ufs_inode->ui_u2.ui_addr.ui_db[i] = ufsi->i_u1.i_data[i];
>
>but
>
>./include/linux/ufs_fs.h:                       __fs32  ui_db[UFS_NDADDR];/*
>0x28 data blocks */
>./include/linux/ufs_fs.h:                       __fs64
>ui_db[UFS_NDADDR]; /* 112: Direct disk blocks. */
>
>and
>
>        __fs32  i_data[15];
>
>and
>
>#define UFS_NDADDR 12
>#define UFS_NINDIR 3
>
>so the kernel seems to be trying to write fifteen bytes into an array only
>twelve
>bytes in size. Suggest code rework.


As I see, linux-kernel is very high volume(noise?) list,
may better wil be resend to relevant mantainer(Andrew Morton?)

^ permalink raw reply	[flat|nested] 5+ messages in thread
* fs/ufs/inode.c:817: warning: array subscript is above array bounds
@ 2007-01-31  9:08 d binderman
  0 siblings, 0 replies; 5+ messages in thread
From: d binderman @ 2007-01-31  9:08 UTC (permalink / raw)
  To: linux-kernel


Hello there,

I just tried to compile Linux kernel 2.6.19.2 with the
new GNU C compiler version 4.3 snapshot 20070126.

The compiler said

fs/ufs/inode.c:817: warning: array subscript is above array bounds

The source code is

        for (i = 0; i < (UFS_NDADDR + UFS_NINDIR); i++)
            ufs_inode->ui_u2.ui_addr.ui_db[i] = ufsi->i_u1.i_data[i];

but

./include/linux/ufs_fs.h:                       __fs32  ui_db[UFS_NDADDR];/* 
0x28 data blocks */
./include/linux/ufs_fs.h:                       __fs64     
ui_db[UFS_NDADDR]; /* 112: Direct disk blocks. */

and

        __fs32  i_data[15];

and

#define UFS_NDADDR 12
#define UFS_NINDIR 3

so the kernel seems to be trying to write fifteen bytes into an array only 
twelve
bytes in size. Suggest code rework.


Regards

David Binderman

_________________________________________________________________
Find Love This New Year With match.com! http://msnuk.match.com


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2007-02-01 20:49 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-01-31 20:10 fs/ufs/inode.c:817: warning: array subscript is above array bounds Tomasz Kvarsin
2007-01-31 21:24 ` Andrew Morton
2007-02-01 20:55   ` Evgeniy Dushistov
2007-01-31 21:27 ` Randy Dunlap
  -- strict thread matches above, loose matches on Subject: below --
2007-01-31  9:08 d binderman

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox