libmultipath: fix another WWID overflow in parse_vpd_pg83()
authorMartin Wilck <mwilck@suse.com>
Mon, 24 Jun 2019 09:27:43 +0000 (11:27 +0200)
committerChristophe Varoqui <christophe.varoqui@opensvc.com>
Wed, 3 Jul 2019 06:31:29 +0000 (08:31 +0200)
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

index eed3528..10306b2 100644 (file)
@@ -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;