From: Baofeng Date: Tue, 12 Apr 2016 10:08:05 +0000 (+0300) Subject: storage: do NOT feed p_strconcat() with NULL. X-Git-Tag: 2.3.0.rc1~3583 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=7279da2bd6f969071743fbb8b35b934215365833;p=thirdparty%2Fdovecot%2Fcore.git 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. --- diff --git a/src/lib-storage/index/dbox-multi/mdbox-storage.c b/src/lib-storage/index/dbox-multi/mdbox-storage.c index b09a6bc25c..a58bd736fb 100644 --- a/src/lib-storage/index/dbox-multi/mdbox-storage.c +++ b/src/lib-storage/index/dbox-multi/mdbox-storage.c @@ -53,9 +53,11 @@ int mdbox_storage_create(struct mail_storage *_storage, 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);