From: Roel Kluin <roel.kluin@gmail.com>
To: ralf@linux-mips.org, linux-mips@linux-mips.org,
Andrew Morton <akpm@linux-foundation.org>
Subject: [PATCH] MIPS: Read buffer overflow
Date: Wed, 29 Jul 2009 22:02:53 +0200 [thread overview]
Message-ID: <4A70AAED.3040404@gmail.com> (raw)
it should tests against ARRAY_SIZE(psp_var_map) instead of sizeof(psp_var_map)
Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
---
ARRAY_SIZE(psp_var_map) is 9.
sizeof(psp_var_map) is 144.
diff --git a/arch/mips/ar7/prom.c b/arch/mips/ar7/prom.c
index a320bce..5ad6f1d 100644
--- a/arch/mips/ar7/prom.c
+++ b/arch/mips/ar7/prom.c
@@ -144,7 +144,7 @@ static char * __init lookup_psp_var_map(u8 num)
{
int i;
- for (i = 0; i < sizeof(psp_var_map); i++)
+ for (i = 0; i < ARRAY_SIZE(psp_var_map); i++)
if (psp_var_map[i].num == num)
return psp_var_map[i].value;
next reply other threads:[~2009-07-29 20:00 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-07-29 20:02 Roel Kluin [this message]
2009-07-29 21:25 ` [PATCH] MIPS: Read buffer overflow Ralf Baechle
-- strict thread matches above, loose matches on Subject: below --
2009-07-31 12:52 Roel Kluin
2009-08-02 22:46 ` Ralf Baechle
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=4A70AAED.3040404@gmail.com \
--to=roel.kluin@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=linux-mips@linux-mips.org \
--cc=ralf@linux-mips.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;
as well as URLs for NNTP newsgroup(s).