diff mbox series

[v2,23/30] libmultipath: parse_vpd_pg80: fix overflow output

Message ID 20190624092756.7769-25-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
"vpd pg80 overflow, 20/20 bytes required" looks weird. Make it clear
that actually 21 bytes are required in this case.

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 efcea468..931a676f 100644
--- a/libmultipath/discovery.c
+++ b/libmultipath/discovery.c
@@ -912,7 +912,7 @@  parse_vpd_pg80(const unsigned char *in, char *out, size_t out_len)
 
 	if (len >= out_len) {
 		condlog(2, "vpd pg80 overflow, %d/%d bytes required",
-			len, (int)out_len);
+			len + 1, (int)out_len);
 		len = out_len - 1;
 	}
 	if (len > 0) {