pci-assign: Fix potential read beyond buffer on -EBUSY
commit82d07945652f16078b172d2bd46659e8f5f30d8e
authorMarkus Armbruster <armbru@redhat.com>
Wed, 26 Feb 2014 17:30:03 +0000 (26 10:30 -0700)
committerAlex Williamson <alex.williamson@redhat.com>
Wed, 26 Feb 2014 17:30:03 +0000 (26 10:30 -0700)
tree72077ca349fb9c721802132aa96d9480fea7333b
parent13665a2d2f675341e73618fcd7f9d36b6c68b509
pci-assign: Fix potential read beyond buffer on -EBUSY

readlink() doesn't write a terminating null byte.
assign_failed_examine() passes the unterminated string to strrchr().
Oops.  Terminate it.

Spotted by Coverity.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
hw/i386/kvm/pci-assign.c