add compression test suite assert crash fix

This commit is contained in:
Michal Hlavinka 2018-07-09 14:03:21 +02:00
parent b6cdfb140c
commit d8aa10f515
2 changed files with 45 additions and 0 deletions

View File

@ -0,0 +1,41 @@
From 64f4464385bbcd763f90abc5e212c569b9279ffa Mon Sep 17 00:00:00 2001
From: Paul Howarth <paul@city-fan.org>
Date: Mon, 2 Jul 2018 11:52:14 +0100
Subject: [PATCH] lib-compression: Fix assert-crash in test suite on 32bit
systems
Fix compilation warnings in test-compression.c due to mismatches
between size_t and uoff_t, which then manifests in assert-crashes
running the test suite on 32bit systems.
---
src/lib-compression/test-compression.c | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/src/lib-compression/test-compression.c b/src/lib-compression/test-compression.c
index 0f7df3d1fe..f62d7d6094 100644
--- a/src/lib-compression/test-compression.c
+++ b/src/lib-compression/test-compression.c
@@ -20,6 +20,7 @@ static void test_compression_handler(const struct compression_handler *handler)
unsigned char buf[IO_BLOCK_SIZE];
const unsigned char *data;
size_t size;
+ uoff_t stream_size;
struct sha1_ctxt sha1;
unsigned char output_sha1[SHA1_RESULTLEN], input_sha1[SHA1_RESULTLEN];
unsigned int i;
@@ -73,11 +74,11 @@ static void test_compression_handler(const struct compression_handler *handler)
file_input = i_stream_create_fd(fd, IO_BLOCK_SIZE);
input = handler->create_istream(file_input, FALSE);
- test_assert(i_stream_get_size(input, FALSE, &size) == 1);
- test_assert(size == compressed_size);
+ test_assert(i_stream_get_size(input, FALSE, &stream_size) == 1);
+ test_assert(stream_size == compressed_size);
- test_assert(i_stream_get_size(input, TRUE, &size) == 1);
- test_assert(size == uncompressed_size);
+ test_assert(i_stream_get_size(input, TRUE, &stream_size) == 1);
+ test_assert(stream_size == uncompressed_size);
sha1_init(&sha1);
for (bool seeked = FALSE;;) {

View File

@ -34,6 +34,9 @@ Patch8: dovecot-2.2.20-initbysystemd.patch
Patch9: dovecot-2.2.22-systemd_w_protectsystem.patch Patch9: dovecot-2.2.22-systemd_w_protectsystem.patch
Patch10: dovecot-2.3.0.1-libxcrypt.patch Patch10: dovecot-2.3.0.1-libxcrypt.patch
# for dovecot <= 2.3.2
Patch11: 64f4464385bbcd763f90abc5e212c569b9279ffa.patch
Source15: prestartscript Source15: prestartscript
BuildRequires: gcc, gcc-c++, openssl-devel, pam-devel, zlib-devel, bzip2-devel, libcap-devel BuildRequires: gcc, gcc-c++, openssl-devel, pam-devel, zlib-devel, bzip2-devel, libcap-devel
@ -135,6 +138,7 @@ This package provides the development files for dovecot.
%patch8 -p1 -b .initbysystemd %patch8 -p1 -b .initbysystemd
%patch9 -p1 -b .systemd_w_protectsystem %patch9 -p1 -b .systemd_w_protectsystem
%patch10 -p1 -b .libxcrypt %patch10 -p1 -b .libxcrypt
%patch11 -p1 -b .64f4464385bbcd763f90abc5e212c569b9279ffa
#pushd dovecot-2*3-pigeonhole-%{pigeonholever} #pushd dovecot-2*3-pigeonhole-%{pigeonholever}
#popd #popd