ref: c6ecf74220bd1a8aaf259f198f9edd81f4b5bc29
parent: ab0173e089599dd60fdbe1da4fa9ed00e71ae54f
author: ngkaho1234 <[email protected]>
date: Tue Oct 20 05:58:52 EDT 2015
FIX: crash occurs when truncating a spare file.
--- a/lwext4/ext4_extent_full.c
+++ b/lwext4/ext4_extent_full.c
@@ -1425,10 +1425,15 @@
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;
}