Skip to content
Permalink
Browse files
fix array index out of bound exception
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>
  • Loading branch information
asha1234-cyber authored and intel-lab-lkp committed Aug 11, 2021
1 parent 761c6d7 commit 3c70bc4978e0cb74c7ba5189c093ecccf4564925
Showing 1 changed file with 1 addition and 1 deletion.
@@ -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;
}

0 comments on commit 3c70bc4

Please sign in to comment.