summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorgkostka <kostka.grzegorz@gmail.com>2016-04-12 17:43:13 +0200
committergkostka <kostka.grzegorz@gmail.com>2016-04-12 17:43:13 +0200
commitaf5034292e3db3d9db5f31479185ef65f8a1cf9a (patch)
tree455824ba1a818533a5310b0ed630eb15c532d9d3 /include
parent44ce3df15ccdbf6dd79801b9320c1eed690496e8 (diff)
ext4_fs: fix possible overflow
Diffstat (limited to 'include')
-rw-r--r--include/ext4_fs.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/include/ext4_fs.h b/include/ext4_fs.h
index b598c5e..9653f47 100644
--- a/include/ext4_fs.h
+++ b/include/ext4_fs.h
@@ -94,7 +94,7 @@ struct ext4_inode_ref {
static inline uint32_t ext4_fs_addr_to_idx_bg(struct ext4_sblock *s,
ext4_fsblk_t baddr)
{
- if (ext4_get32(s, first_data_block))
+ if (ext4_get32(s, first_data_block) && baddr)
baddr--;
return baddr % ext4_get32(s, blocks_per_group);