diff mbox series

[v2,18/30] libmultipath: fix parsing of SCSI name string, iqn format

Message ID 20190624092756.7769-20-mwilck@suse.com (mailing list archive)
State Not Applicable, archived
Delegated to: christophe varoqui
Headers show
Series multipath-tools: gcc9, VPD parsing, and get_uid fixes | expand

Commit Message

Martin Wilck June 24, 2019, 9:27 a.m. UTC
Do not overwrite the leading '8'.

Signed-off-by: Martin Wilck <mwilck@suse.com>
---
 libmultipath/discovery.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/libmultipath/discovery.c b/libmultipath/discovery.c
index 10306b22..45c2931e 100644
--- a/libmultipath/discovery.c
+++ b/libmultipath/discovery.c
@@ -1037,12 +1037,11 @@  parse_vpd_pg83(const unsigned char *in, size_t in_len,
 				}
 			} else {
 				out[0] = '8';
-				len = 1;
 				vpd += 4;
 				vpd_len -= 4;
 				if (vpd_len > out_len - 2)
 					vpd_len = out_len - 2;
-				memcpy(out, vpd, vpd_len);
+				memcpy(out + 1, vpd, vpd_len);
 				len = vpd_len + 1;
 				out[len] = '\0';
 			}