Mercurial > dovecot > core-2.2
changeset 21355:788bd1e04e3d
storage: do NOT feed p_strconcat() with NULL.
p_strconcat will never take NULL as an valid argument.
So ns->list->set.alt_dir has to be checked NULL.
author | Baofeng <baofeng.wang@dovecot.com> |
---|---|
date | Tue, 12 Apr 2016 13:08:05 +0300 |
parents | 30ef85789908 |
children | 05b5601081e1 |
files | src/lib-storage/index/dbox-multi/mdbox-storage.c |
diffstat | 1 files changed, 5 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/src/lib-storage/index/dbox-multi/mdbox-storage.c Mon Dec 19 15:31:50 2016 +0200 +++ b/src/lib-storage/index/dbox-multi/mdbox-storage.c Tue Apr 12 13:08:05 2016 +0300 @@ -54,9 +54,11 @@ dir = mailbox_list_get_root_forced(ns->list, MAILBOX_LIST_PATH_TYPE_DIR); storage->storage_dir = p_strconcat(_storage->pool, dir, "/"MDBOX_GLOBAL_DIR_NAME, NULL); - storage->alt_storage_dir = p_strconcat(_storage->pool, - ns->list->set.alt_dir, - "/"MDBOX_GLOBAL_DIR_NAME, NULL); + if (ns->list->set.alt_dir != NULL) { + storage->alt_storage_dir = p_strconcat(_storage->pool, + ns->list->set.alt_dir, + "/"MDBOX_GLOBAL_DIR_NAME, NULL); + } i_array_init(&storage->open_files, 64); storage->map = mdbox_map_init(storage, ns->list);