]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
dsync: Fixed crash in earlier patch if node didn't have a namespace.
authorTimo Sirainen <tss@iki.fi>
Thu, 5 Feb 2015 17:40:25 +0000 (19:40 +0200)
committerTimo Sirainen <tss@iki.fi>
Thu, 5 Feb 2015 17:40:25 +0000 (19:40 +0200)
This shouldn't have happened except in test-dsync-mailbox-tree-sync, but
easier and safer to fix it here.

src/doveadm/dsync/dsync-mailbox-tree-sync.c

index 88282b12f6f1169ddecdd3d3d6e298f573a2ae97..e1078909b48649e1156deb719d2afd3737f49260 100644 (file)
@@ -361,7 +361,7 @@ static bool sync_node_is_namespace_prefix(struct dsync_mailbox_tree *tree,
                                          struct dsync_mailbox_node *node)
 {
        const char *full_name;
-       unsigned int prefix_len = node->ns->prefix_len;
+       unsigned int prefix_len = node->ns == NULL ? 0 : node->ns->prefix_len;
 
        if (prefix_len == 0)
                return FALSE;