From: walter harms <wharms@bfs.de>
To: Dan Carpenter <error27-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Cc: Steve French <sfrench-eUNUBHrolfbYtjvyW6yDsg@public.gmane.org>,
linux-cifs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
samba-technical-w/Ol4Ecudpl8XjKLYN78aQ@public.gmane.org,
kernel-janitors-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: [patch] cifs: writing past the end of the array
Date: Sun, 06 Mar 2011 17:11:23 +0000 [thread overview]
Message-ID: <4D73C03B.1050905@bfs.de> (raw)
In-Reply-To: <20110306132621.GN3416@bicker>
Am 06.03.2011 14:26, schrieb Dan Carpenter:
> This is a cut and paste error. p16 only has 16 chars, not 21.
>
> Signed-off-by: Dan Carpenter <error27@gmail.com>
>
> diff --git a/fs/cifs/smbencrypt.c b/fs/cifs/smbencrypt.c
> index 3967635..1525d5e 100644
> --- a/fs/cifs/smbencrypt.c
> +++ b/fs/cifs/smbencrypt.c
> @@ -353,7 +353,7 @@ SMBNTencrypt(unsigned char *passwd, unsigned char *c8, unsigned char *p24)
> int rc;
> unsigned char p16[16], p21[21];
>
> - memset(p16, '\0', 21);
> + memset(p16, '\0', 16);
> memset(p21, '\0', 21);
>
> rc = E_md4hash(passwd, p16);
perhaps ARRAY_SIZE() instead of a magic number is a better choice ?
re,
wh
next prev parent reply other threads:[~2011-03-06 17:11 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-03-06 13:26 [patch] cifs: writing past the end of the array Dan Carpenter
2011-03-06 14:56 ` Shirish Pargaonkar
2011-03-06 17:11 ` walter harms [this message]
[not found] ` <4D73C03B.1050905-fPG8STNUNVg@public.gmane.org>
2011-03-07 16:09 ` Jeff Layton
2011-03-08 8:25 ` walter harms
2011-03-08 11:05 ` Dan Carpenter
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=4D73C03B.1050905@bfs.de \
--to=wharms@bfs.de \
--cc=error27-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
--cc=kernel-janitors-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=linux-cifs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=samba-technical-w/Ol4Ecudpl8XjKLYN78aQ@public.gmane.org \
--cc=sfrench-eUNUBHrolfbYtjvyW6yDsg@public.gmane.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