Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757800AbYCaU3X (ORCPT ); Mon, 31 Mar 2008 16:29:23 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1757426AbYCaU3F (ORCPT ); Mon, 31 Mar 2008 16:29:05 -0400 Received: from g5t0007.atlanta.hp.com ([15.192.0.44]:47888 "EHLO g5t0007.atlanta.hp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757419AbYCaU3E (ORCPT ); Mon, 31 Mar 2008 16:29:04 -0400 Date: Mon, 31 Mar 2008 14:29:01 -0600 From: Alex Chiang To: Chris Mason Cc: linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, btrfs-devel@oss.oracle.com Subject: [PATCH 2/2] btrfs-progs: Stop stomping on 'name' input parameter Message-ID: <20080331202901.GC341@ldl.fc.hp.com> Mail-Followup-To: Alex Chiang , Chris Mason , linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, btrfs-devel@oss.oracle.com References: <200802211609.50563.chris.mason@oracle.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200802211609.50563.chris.mason@oracle.com> User-Agent: Mutt/1.5.16 (2007-06-09) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 953 Lines: 39 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 --- hash.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/hash.c b/hash.c index 58f0be6..6a0795d 100644 --- a/hash.c +++ b/hash.c @@ -80,7 +80,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; /* Initialize the default seed for the hash checksum functions */ -- 1.5.3.1.g1e61 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/