diff options
author | Paul Mackerras <paulus@samba.org> | 2008-01-24 00:07:21 +0100 |
---|---|---|
committer | Paul Mackerras <paulus@samba.org> | 2008-01-24 00:07:21 +0100 |
commit | 9156ad48338e0306e508ead5c0d9986050744475 (patch) | |
tree | 37f3a90e38190052ecf3cdf9171dfdddd37b56fd /fs/hfs/brec.c | |
parent | [POWERPC] Provide a way to protect 4k subpages when using 64k pages (diff) | |
parent | Update ctime and mtime for memory-mapped files (diff) | |
download | linux-9156ad48338e0306e508ead5c0d9986050744475.tar.xz linux-9156ad48338e0306e508ead5c0d9986050744475.zip |
Merge branch 'linux-2.6'
Diffstat (limited to 'fs/hfs/brec.c')
-rw-r--r-- | fs/hfs/brec.c | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/fs/hfs/brec.c b/fs/hfs/brec.c index 5c87cf4801fc..8626ee375ea8 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) recoff = hfs_bnode_read_u16(node, node->tree->node_size - (rec + 1) * 2); if (!recoff) return 0; - if (node->tree->attributes & HFS_TREE_BIGKEYS) + if (node->tree->attributes & HFS_TREE_BIGKEYS) { retval = hfs_bnode_read_u16(node, recoff) + 2; - else + if (retval > node->tree->max_key_len + 2) { + printk(KERN_ERR "hfs: keylen %d too large\n", + retval); + retval = HFS_BAD_KEYLEN; + } + } else { retval = (hfs_bnode_read_u8(node, recoff) | 1) + 1; + if (retval > node->tree->max_key_len + 1) { + printk(KERN_ERR "hfs: keylen %d too large\n", + retval); + retval = HFS_BAD_KEYLEN; + } + } } return retval; } |