multipath-tools: fix incorrect length for strncmp in uevent.c
PATCH 1/1 multipath-tools: fix incorrect length for strncmp in uevent.c
Cc Martin Wilck <[email protected]>
Signed-off-by Junxiong Guan <[email protected]>
--- libmultipath/uevent.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
libmultipath/uevent.c +3 -3
@@ -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 ;
Signature · 1 line
2.11.1
Quoted 22 lines · Guan Junxiong
Cc Martin Wilck <[email protected]>Signed-off-by Junxiong Guan <[email protected]>--- libmultipath/uevent.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)libmultipath/uevent.c +1
-1@@ -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 ;libmultipath/uevent.c +0
-0ro =strtoul (p, &q,10 );if (p == q) {
libmultipath/uevent.c char *uevent_get_dm_name(struct uevent *uev) · line 911
Quoted 10 lines
libmultipath/uevent.c +2
-2@@ -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 <[email protected]>
Signature · 8 lines
Dr. Martin Wilck <[email protected]>, 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 [email protected] https://www.redhat.com/mailman/listinfo/dm-devel