]> xenbits.xensource.com Git - libvirt.git/commit
vsh: Don't crash when @text is NULL in vshCompleterFilter()
authorMichal Privoznik <mprivozn@redhat.com>
Mon, 27 May 2024 09:06:41 +0000 (11:06 +0200)
committerMichal Privoznik <mprivozn@redhat.com>
Tue, 28 May 2024 06:52:31 +0000 (08:52 +0200)
commit0a2508ee771ef3a1abf7b6840b551460e8f5512a
treef32c8483d3cf0f4fed0c83389bc4d2a57c2a57b4
parentf6ab0d5bdd984c0a935aabe2bc4e6c00c18cc984
vsh: Don't crash when @text is NULL in vshCompleterFilter()

This can happen only for cmdComplete() in interactive mode (which
I'm still not convinced is any useful for users and whether we
should support it). Anyway, running plain 'complete' command with
no additional arguments boils down to @text being NULL in
vshReadlineParse() which handles the case just right but is then
subsequently passed to vshCompleterFilter() which isn't prepared
for this case.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
tools/vsh.c