From: Martin Wilck <mwilck@suse.com>
To: Guan Junxiong <guanjunxiong@huawei.com>,
dm-devel@redhat.com, christophe.varoqui@opensvc.com
Cc: chengjike.cheng@huawei.com, niuhaoxin@huawei.com, shenhong09@huawei.com
Subject: Re: [PATCH] multipath-tools: fix incorrect length for strncmp in uevent.c
Date: Tue, 05 Sep 2017 20:30:43 +0200 [thread overview]
Message-ID: <1504636243.4516.7.camel@suse.com> (raw)
In-Reply-To: <1504583682-14112-1-git-send-email-guanjunxiong@huawei.com>
On Tue, 2017-09-05 at 11:54 +0800, Guan Junxiong wrote:
> Cc: Martin Wilck <mwilck@suse.com>
> Signed-off-by: Junxiong Guan <guanjunxiong@huawei.com>
> ---
> libmultipath/uevent.c | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/libmultipath/uevent.c b/libmultipath/uevent.c
> index eb44da56..a98633e7 100644
> --- a/libmultipath/uevent.c
> +++ b/libmultipath/uevent.c
> @@ -885,7 +885,7 @@ int uevent_get_disk_ro(struct uevent *uev)
> int i, ro = -1;
>
> for (i = 0; uev->envp[i] != NULL; i++) {
> - if (!strncmp(uev->envp[i], "DISK_RO", 6) &&
> strlen(uev->envp[i]) > 7) {
> + if (!strncmp(uev->envp[i], "DISK_RO", 7) &&
> strlen(uev->envp[i]) > 8) {
> p = uev->envp[i] + 8;
> ro = strtoul(p, &q, 10);
> if (p == q) {
> @@ -904,8 +904,8 @@ char *uevent_get_dm_name(struct uevent *uev)
> int i;
>
> for (i = 0; uev->envp[i] != NULL; i++) {
> - if (!strncmp(uev->envp[i], "DM_NAME", 6) &&
> - strlen(uev->envp[i]) > 7) {
> + if (!strncmp(uev->envp[i], "DM_NAME", 7) &&
> + strlen(uev->envp[i]) > 8) {
> p = MALLOC(strlen(uev->envp[i] + 8) + 1);
> strcpy(p, uev->envp[i] + 8);
> break;
Reviewed-by: Martin Wilck <mwilck@suse.com>
--
Dr. Martin Wilck <mwilck@suse.com>, Tel. +49 (0)911 74053 2107
SUSE Linux GmbH, GF: Felix Imendörffer, Jane Smithard, Graham Norton
HRB 21284 (AG Nürnberg)
--
dm-devel mailing list
dm-devel@redhat.com
https://www.redhat.com/mailman/listinfo/dm-devel
prev parent reply other threads:[~2017-09-05 18:30 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-09-05 3:54 [PATCH] multipath-tools: fix incorrect length for strncmp in uevent.c Guan Junxiong
2017-09-05 18:30 ` Martin Wilck [this message]
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=1504636243.4516.7.camel@suse.com \
--to=mwilck@suse.com \
--cc=chengjike.cheng@huawei.com \
--cc=christophe.varoqui@opensvc.com \
--cc=dm-devel@redhat.com \
--cc=guanjunxiong@huawei.com \
--cc=niuhaoxin@huawei.com \
--cc=shenhong09@huawei.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.