Skip to contentSkip to conversation

hpfs: Initialize memory in `hfs_find_init`

PATCH New Javier Garcia 1 participant 1 message Sep 27, 2025

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 hpfs: Initialize memory in `hfs_find_init`

Avoid the use of uninit-value in hfsplys_strcasecmp and case_fold.

Fixes 1da177e4c3f4 ("Linux-2.6.12-rc2")
Reported-and-tested-by [email protected]
---
 fs/hfsplus/bfind.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/hfsplus/bfind.c +1 -1
index 901e83d65d20..75f1c029c2ed 100644
@@ -18,7 +18,7 @@ int hfs_find_init(struct hfs_btree *tree, struct hfs_find_data *fd)
 
 	fd->tree = tree;
 	fd->bnode = NULL;
-	ptr = kmalloc(tree->max_key_len * 2 + 4, GFP_KERNEL);
+	ptr = kzalloc(tree->max_key_len * 2 + 4, GFP_KERNEL);
 	if (!ptr)
 		return -ENOMEM;
 	fd->search_key = ptr;
Signature · 1 line
2.50.1