summaryrefslogtreecommitdiff
path: root/fs/hfs/bnode.c
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>2025-04-25 11:51:21 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2025-04-25 11:51:21 +0300
commit7f0020417b7bceaa10cf9e1efe2b3f5c554d972e (patch)
tree69d11757acfb4bacfb5f82f6f0fbf04339b3cd38 /fs/hfs/bnode.c
parent616e143c9fd88562b4d2cb235834c620fe65ba22 (diff)
parentea061bad207e1ba693b5488ba64c663f7ca03f50 (diff)
downloadlinux-rolling-stable.tar.xz
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'fs/hfs/bnode.c')
-rw-r--r--fs/hfs/bnode.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/fs/hfs/bnode.c b/fs/hfs/bnode.c
index 6add6ebfef89..cb823a8a6ba9 100644
--- a/fs/hfs/bnode.c
+++ b/fs/hfs/bnode.c
@@ -67,6 +67,12 @@ void hfs_bnode_read_key(struct hfs_bnode *node, void *key, int off)
else
key_len = tree->max_key_len + 1;
+ if (key_len > sizeof(hfs_btree_key) || key_len < 1) {
+ memset(key, 0, sizeof(hfs_btree_key));
+ pr_err("hfs: Invalid key length: %d\n", key_len);
+ return;
+ }
+
hfs_bnode_read(node, key, off, key_len);
}