multipathd: fix REALLOC_REPLY with max length reply
authorBenjamin Marzinski <bmarzins@redhat.com>
Fri, 17 May 2019 16:14:09 +0000 (11:14 -0500)
committerChristophe Varoqui <christophe.varoqui@opensvc.com>
Wed, 3 Jul 2019 06:03:52 +0000 (08:03 +0200)
commit28904ec29c58e08c3292401fae1684c6b8d1703e
tree9f681afe63159f1b88953dcdb2ed6c1c1cb64322
parent14c7c5c042138901f3d6b1eb7d6d61e626c3a66b
multipathd: fix REALLOC_REPLY with max length reply

Commit cd5a9797e added code to REALLOC_REPLY() that intended to stop
growing the reply buffer after it reached a maximum size. However this
code didn't stop the realloc() from happening. Worse, if the realloc()
failed, multipathd would double free the reply buffer. Found by
Coverity.

Fixes: cd5a9797e "libmpathcmd(coverity): limit reply length"
Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
multipathd/cli.h