From 00602abe001d94ce4b06574f7f39cde53854cc4f Mon Sep 17 00:00:00 2001 From: "Daniel P. Berrange" Date: Tue, 27 Feb 2007 15:35:50 +0000 Subject: [PATCH] Fix SEGV in tab completion of virsh commands --- ChangeLog | 5 +++++ src/virsh.c | 3 +++ 2 files changed, 8 insertions(+) diff --git a/ChangeLog b/ChangeLog index 535b59327c..c6a9bf0bcf 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Tue Feb 27 10:35:35 EST 2007 Daniel P. Berrange + + * src/virsh.c: Fix SEGV when doing tab-completion of commands + which have no arguments (eg, nodeinfo). + Tue Feb 27 10:25:35 EST 2007 Daniel P. Berrange * src/virsh.c: Fix command line argument parsing to make diff --git a/src/virsh.c b/src/virsh.c index 6274108887..14b402e579 100644 --- a/src/virsh.c +++ b/src/virsh.c @@ -3207,6 +3207,9 @@ vshReadlineOptionsGenerator(const char *text, int state) if (!cmd) return NULL; + if (!cmd->opts) + return NULL; + while ((name = cmd->opts[list_index].name)) { vshCmdOptDef *opt = &cmd->opts[list_index]; char *res; -- 2.47.2