]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-storage: raw-mail - Cast st_size to uoff_t
authorAki Tuomi <aki.tuomi@open-xchange.com>
Wed, 28 Oct 2020 10:22:58 +0000 (12:22 +0200)
committerAki Tuomi <aki.tuomi@open-xchange.com>
Wed, 28 Oct 2020 10:26:47 +0000 (12:26 +0200)
mbox->size is unsigned field, and st_size will be -1
is the stat target is not regular file or symbolic link.
This can happen if it's stream like stdin.

src/lib-storage/index/raw/raw-mail.c

index 23143c33d920d90b51e9330ffb69d1fe13ad21ba..b8bbb87cd98c140cf87c42d3d512a06c0a76cb90 100644 (file)
@@ -31,7 +31,7 @@ static int raw_mail_stat(struct mail *mail)
                mbox->mtime = st->st_mtime;
        if (mbox->ctime != (time_t)-1)
                mbox->ctime = st->st_ctime;
-       mbox->size = st->st_size;
+       mbox->size = (size_t)st->st_size;
        return 0;
 }