]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
Fix SEGV in tab completion of virsh commands
authorDaniel P. Berrange <berrange@redhat.com>
Tue, 27 Feb 2007 15:35:50 +0000 (15:35 +0000)
committerDaniel P. Berrange <berrange@redhat.com>
Tue, 27 Feb 2007 15:35:50 +0000 (15:35 +0000)
ChangeLog
src/virsh.c

index 535b59327c61d3cf85cad82d480a38be9420d481..c6a9bf0bcfbc404a7740ab785edb91bf0e408a1f 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Tue Feb 27 10:35:35 EST 2007 Daniel P. Berrange <berrange@redhat.com>
+
+       * src/virsh.c: Fix SEGV when doing tab-completion of commands
+       which have no arguments (eg, nodeinfo<TAB>).
+
 Tue Feb 27 10:25:35 EST 2007 Daniel P. Berrange <berrange@redhat.com>
 
        * src/virsh.c: Fix command line argument parsing to make
index 6274108887cfc6c60a9998d9f0985508ca8a008c..14b402e579bc831b75ed3ed7112ca3760c2adb18 100644 (file)
@@ -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;