* [PATCH] multipath-tools: fix incorrect length for strncmp in uevent.c
@ 2017-09-05 3:54 Guan Junxiong
2017-09-05 18:30 ` Martin Wilck
0 siblings, 1 reply; 2+ messages in thread
From: Guan Junxiong @ 2017-09-05 3:54 UTC (permalink / raw)
To: dm-devel, christophe.varoqui
Cc: guanjunxiong, chengjike.cheng, mwilck, shenhong09, niuhaoxin
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;
--
2.11.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] multipath-tools: fix incorrect length for strncmp in uevent.c
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
0 siblings, 0 replies; 2+ messages in thread
From: Martin Wilck @ 2017-09-05 18:30 UTC (permalink / raw)
To: Guan Junxiong, dm-devel, christophe.varoqui
Cc: chengjike.cheng, niuhaoxin, shenhong09
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
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2017-09-05 18:30 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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 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.