summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorngkaho1234 <ngkaho1234@gmail.com>2015-10-20 09:58:52 +0000
committerngkaho1234 <ngkaho1234@gmail.com>2015-10-20 11:05:42 +0000
commitc6ecf74220bd1a8aaf259f198f9edd81f4b5bc29 (patch)
tree21bf779af1d53c2d1cd5758ad7dc12068c1711df
parentab0173e089599dd60fdbe1da4fa9ed00e71ae54f (diff)
FIX: crash occurs when truncating a spare file.
-rw-r--r--lwext4/ext4_extent_full.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/lwext4/ext4_extent_full.c b/lwext4/ext4_extent_full.c
index 0028287..692eb12 100644
--- a/lwext4/ext4_extent_full.c
+++ b/lwext4/ext4_extent_full.c
@@ -1425,10 +1425,15 @@ int ext4_extent_remove_space(struct ext4_inode_ref *inode_ref, ext4_lblk_t from,
if (ret)
goto out;
+ if (!path[depth].extent) {
+ ret = EOK;
+ goto out;
+ }
+
bool in_range = IN_RANGE(from, to_le32(path[depth].extent->first_block),
ext4_ext_get_actual_len(path[depth].extent));
- if (!path[depth].extent || !in_range) {
+ if (!in_range) {
ret = EOK;
goto out;
}