aboutsummaryrefslogtreecommitdiffstats
path: root/fs/hfs/brec.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/hfs/brec.c')
-rw-r--r--fs/hfs/brec.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/fs/hfs/brec.c b/fs/hfs/brec.c
index 5c87cf4801f..8626ee375ea 100644
--- a/fs/hfs/brec.c
+++ b/fs/hfs/brec.c
@@ -44,10 +44,21 @@ u16 hfs_brec_keylen(struct hfs_bnode *node, u16 rec)
44 recoff = hfs_bnode_read_u16(node, node->tree->node_size - (rec + 1) * 2); 44 recoff = hfs_bnode_read_u16(node, node->tree->node_size - (rec + 1) * 2);
45 if (!recoff) 45 if (!recoff)
46 return 0; 46 return 0;
47 if (node->tree->attributes & HFS_TREE_BIGKEYS) 47 if (node->tree->attributes & HFS_TREE_BIGKEYS) {
48 retval = hfs_bnode_read_u16(node, recoff) + 2; 48 retval = hfs_bnode_read_u16(node, recoff) + 2;
49 else 49 if (retval > node->tree->max_key_len + 2) {
50 printk(KERN_ERR "hfs: keylen %d too large\n",
51 retval);
52 retval = HFS_BAD_KEYLEN;
53 }
54 } else {
50 retval = (hfs_bnode_read_u8(node, recoff) | 1) + 1; 55 retval = (hfs_bnode_read_u8(node, recoff) | 1) + 1;
56 if (retval > node->tree->max_key_len + 1) {
57 printk(KERN_ERR "hfs: keylen %d too large\n",
58 retval);
59 retval = HFS_BAD_KEYLEN;
60 }
61 }
51 } 62 }
52 return retval; 63 return retval;
53} 64}