diff mbox series

[v2,17/30] libmultipath: fix another WWID overflow in parse_vpd_pg83()

Message ID 20190624092756.7769-19-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
This one is an obvious typo.

Fixes: 18176202e75c "Read wwid from sysfs vpg_pg83 attribute"
Signed-off-by: Martin Wilck <mwilck@suse.com>
---
 libmultipath/discovery.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/libmultipath/discovery.c b/libmultipath/discovery.c
index eed35284..10306b22 100644
--- a/libmultipath/discovery.c
+++ b/libmultipath/discovery.c
@@ -1040,7 +1040,7 @@  parse_vpd_pg83(const unsigned char *in, size_t in_len,
 				len = 1;
 				vpd += 4;
 				vpd_len -= 4;
-				if (vpd_len > out_len + 2)
+				if (vpd_len > out_len - 2)
 					vpd_len = out_len - 2;
 				memcpy(out, vpd, vpd_len);
 				len = vpd_len + 1;