Re: [PATCH] cmdDomBlkError: Fix crash when initial call to virDomainGetDiskErrors fails

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Apr 19, 2021 at 08:25:00AM +0200, Peter Krempa wrote:
> virDomainGetDiskErrors uses the weird semantics where we make the
> caller query for the number of elements and then pass pre-allocated
> structure.
> 
> The cleanup section errorneously used the 'count' variable to free the
> allocated elements for the API but 'count' can be '-1' in cases when the
> API returns failure, thus attempting to free beyond the end of the
> array.
> 
> Resolves: https://gitlab.com/libvirt/libvirt/-/issues/155
> Signed-off-by: Peter Krempa <pkrempa@xxxxxxxxxx>
> ---
>  tools/virsh-domain-monitor.c | 10 +++++-----
>  1 file changed, 5 insertions(+), 5 deletions(-)

Reviewed-by: Pavel Hrdina <phrdina@xxxxxxxxxx>

Attachment: signature.asc
Description: PGP signature


[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux