Skip to content

Commit 5783f64

Browse files
authored
Merge pull request #61 from rahmanih/fix_issue_53
fix: Wrong out-of-range check in lx_nand_flash_block_find.
2 parents 04e385f + 0f7dd52 commit 5783f64

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

common/src/lx_nand_flash_block_find.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ UINT _lx_nand_flash_block_find(LX_NAND_FLASH *nand_flash, ULONG logical_sector,
9090
block_mapping_index = logical_sector / nand_flash -> lx_nand_flash_pages_per_block;
9191

9292
/* Check the address range. */
93-
if (block_mapping_index > nand_flash -> lx_nand_flash_block_mapping_table_size / sizeof(*nand_flash -> lx_nand_flash_block_mapping_table))
93+
if (block_mapping_index >= nand_flash -> lx_nand_flash_block_mapping_table_size / sizeof(*nand_flash -> lx_nand_flash_block_mapping_table))
9494
{
9595

9696
/* Out of range, return an error. */

0 commit comments

Comments
 (0)