]> git.proxmox.com Git - pve-cluster.git/commitdiff
pmxcfs: fix segfault in cfs_create_status_msg
authorFabian Grünbichler <f.gruenbichler@proxmox.com>
Tue, 13 Jun 2017 13:22:05 +0000 (15:22 +0200)
committerWolfgang Bumiller <w.bumiller@proxmox.com>
Tue, 13 Jun 2017 13:49:57 +0000 (15:49 +0200)
it's possible to request a status message for a no longer
existing nodename in a standalone setting (e.g., node was
renamed after pmxcfs was started).

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
data/src/status.c

index 5fe1eb9e94d1862f018a7f032a638a795b498151..030c003bdb79efdaa22f152b5ae7b7513427b6cb 100644 (file)
@@ -1299,7 +1299,7 @@ cfs_create_status_msg(
 
        if (!nodename || !nodename[0] || !strcmp(nodename, cfs.nodename)) {
                kvhash = cfs_status.kvhash;
-       } else {
+       } else if (cfs_status.clinfo && cfs_status.clinfo->nodes_byname) {
                cfs_clnode_t *clnode;
                if ((clnode = g_hash_table_lookup(cfs_status.clinfo->nodes_byname, nodename)))
                        kvhash = clnode->kvhash;