libmultipath: format_devname: avoid buffer overflow
authorMartin Wilck <mwilck@suse.com>
Sat, 12 Oct 2019 21:27:43 +0000 (21:27 +0000)
committerChristophe Varoqui <christophe.varoqui@opensvc.com>
Mon, 2 Mar 2020 08:16:29 +0000 (09:16 +0100)
commitf41b8f6d8d0341aef841dab53f82f84a2771b7c1
treeb8ae6cf2f5e024c653ddb1687405d7efa9c439b5
parent1ec4dc27010d73abee2b60c75ef7cb49517a2849
libmultipath: format_devname: avoid buffer overflow

If the buffer was too short, the current code could write
the terminating 0 byte after the actual buffer.

Also, assert sufficient buffer length, and positive id.

Signed-off-by: Martin Wilck <mwilck@suse.com>
libmultipath/alias.c