]> git.ipfire.org Git - thirdparty/open-vm-tools.git/commitdiff
Fix a namespace tool crash.
authorOliver Kurth <okurth@vmware.com>
Fri, 15 Sep 2017 18:22:53 +0000 (11:22 -0700)
committerOliver Kurth <okurth@vmware.com>
Fri, 15 Sep 2017 18:22:53 +0000 (11:22 -0700)
The namespace tool core-dumps when running the following command
vmware-namespace-cmd -V get-value name -k key

This is because glib options parser removed the -V from the argv,
and passed the ValidateNsCommands() check. However, the later
RunNamespacecommand shall ASSERT() on the NULL nscmd.

open-vm-tools/namespacetool/namespacetool.c

index ef405015494ca1cba03dc5758588177eaa5ee169..897e79f21fa47d365bef29c19d46715a3ed585d2 100644 (file)
@@ -704,7 +704,7 @@ main(int argc, char *argv[])
     *  Validating namespace command name after g_context_parser
     *  because argv[1] can have string "--help"
     */
-   if (argc > 1 && ValidateNSCommands(argv[1]) == FALSE) {
+   if (argc > 1 && ValidateNSCommands(nsOptions.cmdName) == FALSE) {
       goto exit;
    }