]> git.proxmox.com Git - mirror_qemu.git/commit
block/ssh: fix possible segmentation fault when .desc is not null-terminated
authorMurilo Opsfelder Araujo <muriloo@linux.vnet.ibm.com>
Fri, 5 Jan 2018 14:44:40 +0000 (12:44 -0200)
committerMichael Roth <mdroth@linux.vnet.ibm.com>
Wed, 20 Jun 2018 20:20:44 +0000 (15:20 -0500)
commit82c5191f9c820a9500fa29904e96067b1c394dfc
tree5f66e53dfb2e6dde3519477d9d1bb207e143d231
parent72cc467aabd1a2a51baa9406aa331b3142997f18
block/ssh: fix possible segmentation fault when .desc is not null-terminated

This patch prevents a possible segmentation fault when .desc members are checked
against NULL.

The ssh_runtime_opts was added by commit
8a6a80896d6af03b8ee0c17cdf37219eca2588a7 ("block/ssh: Use QemuOpts for runtime
options").

This fix was inspired by
http://lists.nongnu.org/archive/html/qemu-devel/2018-01/msg00883.html.

Fixes: 8a6a80896d6af03b8ee0c17cdf37219eca2588a7 ("block/ssh: Use QemuOpts for runtime options")
Cc: Max Reitz <mreitz@redhat.com>
Cc: Eric Blake <eblake@redhat.com>
Signed-off-by: Murilo Opsfelder Araujo <muriloo@linux.vnet.ibm.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Jeff Cody <jcody@redhat.com>
Signed-off-by: Jeff Cody <jcody@redhat.com>
(cherry picked from commit fbd5c4c0db47e578e3fdd88a0ebc4314a1ed3d42)
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
block/ssh.c