summaryrefslogtreecommitdiff
path: root/src/ext4_dir.c
diff options
context:
space:
mode:
authorrajeshvenkataraman <rajesh_venkataraman@trimble.com>2018-09-23 07:49:30 -0700
committerGrzegorz Kostka <kostka.grzegorz@gmail.com>2018-09-26 22:22:36 +0200
commit1aa974054274a4f59dfa59c88bb9a85461eca113 (patch)
tree1e2f06b696787f9486f8f3a53848710a634d0437 /src/ext4_dir.c
parentdc0347cc9b3ea74da062c553dbcdc541c030f114 (diff)
ext4_dir: fix non existing entry creation issue
Added the length of the name string a a parameter. Using strlen() on the name string may not give the correct length in case of paths like: /mountpoint/nonexistdir1/nonexistdir2.
Diffstat (limited to 'src/ext4_dir.c')
-rw-r--r--src/ext4_dir.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/ext4_dir.c b/src/ext4_dir.c
index b11d6c2..29a51c5 100644
--- a/src/ext4_dir.c
+++ b/src/ext4_dir.c
@@ -351,7 +351,7 @@ int ext4_dir_add_entry(struct ext4_inode_ref *parent, const char *name,
/* Index adding (if allowed) */
if ((ext4_sb_feature_com(sb, EXT4_FCOM_DIR_INDEX)) &&
(ext4_inode_has_flag(parent->inode, EXT4_INODE_FLAG_INDEX))) {
- r = ext4_dir_dx_add_entry(parent, child, name);
+ r = ext4_dir_dx_add_entry(parent, child, name, name_len);
/* Check if index is not corrupted */
if (r != EXT4_ERR_BAD_DX_DIR) {