mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Alex Chiang <achiang@hp.com>
To: Chris Mason <chris.mason@oracle.com>
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
Date: Mon, 31 Mar 2008 14:29:01 -0600	[thread overview]
Message-ID: <20080331202901.GC341@ldl.fc.hp.com> (raw)
In-Reply-To: <200802211609.50563.chris.mason@oracle.com>

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>
---
 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


  parent reply	other threads:[~2008-03-31 20:29 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-02-21 21:09 [ANNOUNCE] Btrfs v0.13 Chris Mason
2008-02-21 21:12 ` Chris Mason
2008-03-31 20:26 ` Alex Chiang
2008-03-31 20:35   ` Alex Chiang
2008-03-31 20:45   ` David Miller
2008-03-31 22:43     ` Alex Chiang
2008-03-31 23:25       ` Alex Chiang
2008-04-01 15:58       ` Chris Mason
2008-03-31 22:47     ` Alex Chiang
2008-04-01  0:40       ` Alex Chiang
2008-04-01 13:38         ` Chris Mason
2008-03-31 20:52   ` Chris Mason
2008-03-31 21:02     ` Alex Chiang
2008-03-31 20:28 ` [PATCH 1/2] btrfs-progs: Fix printf format casting errors Alex Chiang
2008-03-31 20:29 ` Alex Chiang [this message]
2008-04-01 23:28 ` [ANNOUNCE] Btrfs v0.13 Badari Pulavarty
2008-04-01 23:33   ` Badari Pulavarty
2008-04-03 16:51 ` [PATCH] btrfs - replace div_long_long_rem() Badari Pulavarty

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20080331202901.GC341@ldl.fc.hp.com \
    --to=achiang@hp.com \
    --cc=btrfs-devel@oss.oracle.com \
    --cc=chris.mason@oracle.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome