From: Timo Sirainen Date: Thu, 26 May 2016 18:40:30 +0000 (+0300) Subject: sdbox: Make sure we don't crash when altmove-flag is set but alt path is missing. X-Git-Tag: 2.3.0.rc1~3647 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=901f49833183c9360fd04002fa94a47f8f7129ed;p=thirdparty%2Fdovecot%2Fcore.git sdbox: Make sure we don't crash when altmove-flag is set but alt path is missing. --- diff --git a/src/lib-storage/index/dbox-single/sdbox-file.c b/src/lib-storage/index/dbox-single/sdbox-file.c index 56e5b98cdf..a0401dcfa7 100644 --- a/src/lib-storage/index/dbox-single/sdbox-file.c +++ b/src/lib-storage/index/dbox-single/sdbox-file.c @@ -302,6 +302,8 @@ int sdbox_file_move(struct dbox_file *file, bool alt_path) if (dbox_file_is_in_alt(file) == alt_path) return 0; + if (file->alt_path == NULL) + return 0; if (stat(file->cur_path, &st) < 0 && errno == ENOENT) { /* already expunged/moved by another session */