From: Zdenek Kabelac <zkabelac@redhat.com>
To: lvm-devel@redhat.com
Subject: [PATCH] Use correct array size!
Date: Mon, 15 Mar 2010 10:03:46 +0100 [thread overview]
Message-ID: <4B9DF7F2.4010304@redhat.com> (raw)
In-Reply-To: <8db1b9ee17a8c097a7b3.1268439437@localhost>
On 13.3.2010 01:17, Malahal Naineni wrote:
> Signed-off-by: Malahal Naineni (malahal at us.ibm.com)
>
> diff -r 5d08ba4ae8e8 -r 8db1b9ee17a8 daemons/dmeventd/dmeventd.c
> --- a/daemons/dmeventd/dmeventd.c Thu Mar 11 16:05:21 2010 -0800
> +++ b/daemons/dmeventd/dmeventd.c Fri Mar 12 16:15:25 2010 -0800
> @@ -1369,7 +1369,7 @@ static int _handle_request(struct dm_eve
> { DM_EVENT_CMD_ACTIVE, _active},
> }, *req;
>
> - for (req = requests; req < requests + sizeof(requests); req++)
> + for (req = requests; req < requests + sizeof(requests) / sizeof(requests[0]); req++)
> if (req->cmd == msg->cmd)
> return req->f(message_data);
NACK
Moving via pointers - thus you need to check whether pointer passes
array boundary (just like C++ vector() iterator)
see the difference:
for(req = 0; i < sizeof(requests) / sizeof(requests[0]); req++0
Zdenek
next prev parent reply other threads:[~2010-03-15 9:03 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-03-13 0:17 [PATCH] Use correct array size! Malahal Naineni
2010-03-15 9:03 ` Zdenek Kabelac [this message]
2010-03-15 9:05 ` Zdenek Kabelac
2010-03-15 9:10 ` Zdenek Kabelac
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=4B9DF7F2.4010304@redhat.com \
--to=zkabelac@redhat.com \
--cc=lvm-devel@redhat.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.