]> git.ipfire.org Git - thirdparty/libvirt.git/commit
virsh: fix entering interactive session
authorRoman Bogorodskiy <bogorodskiy@gmail.com>
Sat, 23 May 2026 07:24:48 +0000 (09:24 +0200)
committerRoman Bogorodskiy <bogorodskiy@gmail.com>
Mon, 25 May 2026 08:58:15 +0000 (10:58 +0200)
commitebeb4426c5151bb7d9b8ef03479e55a8e93e4328
tree41abfeb45cf78cfb3fa804f819fe3d6cd75c66ef
parent05ff74ad06bbb924de78770881bf300ed7de4242
virsh: fix entering interactive session

When entering an interactive session, that is, without a command
specified:

  virsh --connect $URI

virsh currently segfaults because it tries to access
ctl->cmd->def->handler and the ctl->cmd is NULL.

Fix by checking if ctl->cmd is not NULL before doing further checks.

Fixes: b489eb8d6b52d4183754a5d1da55006148a331e4
Signed-off-by: Roman Bogorodskiy <bogorodskiy@gmail.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
tools/virsh.c