]> git.ipfire.org Git - thirdparty/libvirt.git/commit
virsh: Properly terminate string list in virshDomainInterfaceSourceModeCompleter()
authorMichal Privoznik <mprivozn@redhat.com>
Fri, 11 Mar 2022 08:13:56 +0000 (09:13 +0100)
committerMichal Privoznik <mprivozn@redhat.com>
Tue, 15 Mar 2022 12:36:43 +0000 (13:36 +0100)
commitc21e271d36e71b8c2feef99dfea30562f2c1fbee
tree6d1f5bcac62c5fedb280f3bcf6528ee953cbf144
parent2804fa912fa160e38e4ce7f537b6f6e1dcd5ee9d
virsh: Properly terminate string list in virshDomainInterfaceSourceModeCompleter()

A completer must return a NULL terminated list of strings, which
means that when dealing with enums, it has to allocate one
pointer more than the value of VIR_XXX_LAST. But this is not
honoured in virshDomainInterfaceSourceModeCompleter() leading to
out of bounds read.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
tools/virsh-completer-domain.c