fix mail storage block count parsing (#1974281)

Resolves: #1974281
This commit is contained in:
Michal Hlavinka 2021-07-14 11:41:00 +02:00
parent 7eba6ac53f
commit 1e547c27d1
2 changed files with 26 additions and 1 deletions

View File

@ -0,0 +1,20 @@
diff -up dovecot-2.3.8/src/lib-storage/index/index-mail-binary.c.blockcount dovecot-2.3.8/src/lib-storage/index/index-mail-binary.c
--- dovecot-2.3.8/src/lib-storage/index/index-mail-binary.c.blockcount 2020-12-02 11:34:10.229027593 +0100
+++ dovecot-2.3.8/src/lib-storage/index/index-mail-binary.c 2020-12-02 11:36:47.328933276 +0100
@@ -339,13 +339,14 @@ blocks_count_lines(struct binary_ctx *ct
i_stream_skip(full_input, skip);
cur_block_offset += skip;
- if (cur_block->input->eof) {
+ if (i_stream_read_eof(cur_block->input)) {
/* go to the next block */
- if (++block_idx == block_count) {
+ if (block_idx+1 == block_count) {
i_assert(i_stream_read_eof(full_input));
ret = -1;
break;
}
+ block_idx++;
cur_block++;
cur_block_offset = 0;
}

View File

@ -5,7 +5,7 @@ Name: dovecot
Epoch: 1 Epoch: 1
Version: 2.3.14 Version: 2.3.14
%global prever %{nil} %global prever %{nil}
Release: 4%{?dist} Release: 5%{?dist}
#dovecot itself is MIT, a few sources are PD, pigeonhole is LGPLv2 #dovecot itself is MIT, a few sources are PD, pigeonhole is LGPLv2
License: MIT and LGPLv2 License: MIT and LGPLv2
@ -39,6 +39,7 @@ Patch15: dovecot-2.3.11-bigkey.patch
# hard to break circular dependency between lib and lib-dcrypt # hard to break circular dependency between lib and lib-dcrypt
Patch16: dovecot-2.3.6-opensslhmac.patch Patch16: dovecot-2.3.6-opensslhmac.patch
Patch17: dovecot-2.3.14-opensslv3.patch Patch17: dovecot-2.3.14-opensslv3.patch
Patch18: dovecot-2.3.8-blockcount.patch
Source15: prestartscript Source15: prestartscript
@ -129,6 +130,7 @@ This package provides the development files for dovecot.
%patch15 -p1 -b .bigkey %patch15 -p1 -b .bigkey
%patch16 -p1 -b .opensslhmac %patch16 -p1 -b .opensslhmac
%patch17 -p1 -b .opensslv3 %patch17 -p1 -b .opensslv3
%patch18 -p1 -b .blockcount
#pushd dovecot-2*3-pigeonhole-%{pigeonholever} #pushd dovecot-2*3-pigeonhole-%{pigeonholever}
#popd #popd
@ -454,6 +456,9 @@ make check
%{_libdir}/%{name}/dict/libdriver_pgsql.so %{_libdir}/%{name}/dict/libdriver_pgsql.so
%changelog %changelog
* Wed Jul 14 2021 Michal Hlavinka <mhlavink@redhat.com> - 1:2.3.14-5
- fix mail storage block count parsing (#1974281)
* Wed Jun 16 2021 Mohan Boddu <mboddu@redhat.com> - 1:2.3.14-4 * Wed Jun 16 2021 Mohan Boddu <mboddu@redhat.com> - 1:2.3.14-4
- Rebuilt for RHEL 9 BETA for openssl 3.0 - Rebuilt for RHEL 9 BETA for openssl 3.0
Related: rhbz#1971065 Related: rhbz#1971065