libmultipath: fix possible WWID overflow in parse_vpd_pg83()
authorMartin Wilck <mwilck@suse.com>
Mon, 24 Jun 2019 09:27:42 +0000 (11:27 +0200)
committerChristophe Varoqui <christophe.varoqui@opensvc.com>
Wed, 3 Jul 2019 06:31:27 +0000 (08:31 +0200)
commita47fa6ccc3a55766654b3e7530d900ec5ebba24b
tree02fff6d0ce4ca37963c73ec5f080d9c7755d9be6
parentdbb1f92fbdec099c93faf3df0ed5bfa27b9f9791
libmultipath: fix possible WWID overflow in parse_vpd_pg83()

We have to check the remaining length before printing to the
output buffer, not afterwards.

Fixes: 18176202e75c "Read wwid from sysfs vpg_pg83 attribute"
Signed-off-by: Martin Wilck <mwilck@suse.com>
libmultipath/discovery.c