]> git.karo-electronics.de Git - linux-beck.git/commitdiff
btrfs-progs: Stop stomping on 'name' input parameter
authorAlex Chiang <achiang@hp.com>
Tue, 1 Apr 2008 15:21:40 +0000 (11:21 -0400)
committerChris Mason <chris.mason@oracle.com>
Thu, 25 Sep 2008 15:04:01 +0000 (11:04 -0400)
In btrfs_name_hash, Local variable 'buf' is declared as

__u32 buf[2];

but we then try to do this:

buf[0] = 0x67452301;
buf[1] = 0xefcdab89;
buf[2] = 0x98badcfe;
buf[3] = 0x10325476;

Oops. Fix buf to be the proper size.

Signed-off-by: Alex Chiang <achiang@hp.com>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
fs/btrfs/hash.c

index d5252f5c9d0171d970eccda9e7b77367fe16f51d..21037cfca9bde6a4b527f7cb02489937ad563416 100644 (file)
@@ -81,7 +81,7 @@ u64 btrfs_name_hash(const char *name, int len)
        __u32   hash;
        __u32   minor_hash = 0;
        const char      *p;
-       __u32           in[8], buf[2];
+       __u32           in[8], buf[4];
        u64             hash_result;
 
        if (len == 1 && *name == '.') {