From: Jan Kara <jack@suse.cz>
To: "F.A. SULAIMAN" <asha.16@itfac.mrt.ac.lk>
Cc: jack@suse.com, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] fix array index out of bound exception
Date: Wed, 11 Aug 2021 16:59:21 +0200 [thread overview]
Message-ID: <20210811145921.GG14725@quack2.suse.cz> (raw)
In-Reply-To: <20210811131150.20282-1-asha.16@itfac.mrt.ac.lk>
On Wed 11-08-21 18:41:50, F.A. SULAIMAN wrote:
> From: "F.A.Sulaiman" <asha.16@itfac.mrt.ac.lk>
>
> Array index out of bound exception occurs when the 'part' variable is
> passed into the freeSpactTable array, this can be avoided using pointer
> arithmetic.
>
> Signed-off-by: F.A. SULAIMAN <asha.16@itfac.mrt.ac.lk>
I'm sorry but this doesn't even compile and the change is obviously
bogus...
Honza
> ---
> fs/udf/super.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/fs/udf/super.c b/fs/udf/super.c
> index 2f83c1204e20..d330c7162c3a 100644
> --- a/fs/udf/super.c
> +++ b/fs/udf/super.c
> @@ -2522,7 +2522,7 @@ static unsigned int udf_count_free(struct super_block *sb)
> sbi->s_lvid_bh->b_data;
> if (le32_to_cpu(lvid->numOfPartitions) > part) {
> accum = le32_to_cpu(
> - lvid->freeSpaceTable[part]);
> + (lvid->freeSpaceTable + part));
> if (accum == 0xFFFFFFFF)
> accum = 0;
> }
> --
> 2.17.1
>
--
Jan Kara <jack@suse.com>
SUSE Labs, CR
next prev parent reply other threads:[~2021-08-11 14:59 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-08-11 13:11 [PATCH] fix array index out of bound exception F.A. SULAIMAN
2021-08-11 14:59 ` Jan Kara [this message]
2021-08-11 16:31 ` kernel test robot
2021-08-11 17:23 ` kernel test robot
2021-08-11 17:24 ` kernel test robot
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210811145921.GG14725@quack2.suse.cz \
--to=jack@suse.cz \
--cc=asha.16@itfac.mrt.ac.lk \
--cc=jack@suse.com \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).