Re: [PATCH 07/14] virsh-completer: virStringListFree where possible

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

 



On Mon, Apr 01, 2019 at 09:33:24 +0200, Ján Tomko wrote:
> We've been open-coding virStringListFreeCount for cleaning up
> the completion list we're building. This had the advantage of
> zeoring the pointer afterwards, which is no longer needed
> now that we compile the list in 'tmp' instead of 'ret'.

But now you are not preserving the holy NULLs on the stack!!.

> 
> Since all our lists are NULL-terminated anyway, switch to using
> virStringListFree which has the benefit of being usable with
> our VIR_AUTOSTRINGLIST macro.
> 
> Fixes nearly impossible NULL dereferences in
>   virshNWFilterBindingNameCompleter
>   virshNWFilterNameCompleter
>   virshNodeDeviceNameCompleter
>   virshNetworkNameCompleter
>   virshInterfaceNameCompleter
>   virshStoragePoolNameCompleter
>   virshDomainNameCompleter
> which jumped on the error label after a failed allocation
> and a possible one in
>   virshStorageVolNameCompleter
> which jumped there when we fail to fetch the list of volumes.
> 
> Signed-off-by: Ján Tomko <jtomko@xxxxxxxxxx>
> ---

ACK

Attachment: signature.asc
Description: PGP signature

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list

[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