From: Aki Tuomi Date: Mon, 4 Apr 2022 16:12:47 +0000 (+0300) Subject: lib-dcrypt: test-stream - Ensure file is v2 in test_read_garbage X-Git-Tag: 2.4.0~4169 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=8cb9cc5f24eda108ccdc439065298e7266e6adb9;p=thirdparty%2Fdovecot%2Fcore.git lib-dcrypt: test-stream - Ensure file is v2 in test_read_garbage --- diff --git a/src/lib-dcrypt/test-stream.c b/src/lib-dcrypt/test-stream.c index b067e61c32..8ec0a34581 100644 --- a/src/lib-dcrypt/test-stream.c +++ b/src/lib-dcrypt/test-stream.c @@ -596,7 +596,8 @@ static void test_read_garbage(void) unsigned char buf[512]; for (int i = 0; i < 5; i++) { memcpy(buf, IOSTREAM_CRYPT_MAGIC, sizeof(IOSTREAM_CRYPT_MAGIC)); - random_fill(buf + 9, sizeof(buf) - 9); + buf[sizeof(IOSTREAM_CRYPT_MAGIC)+1] = '\x02'; + random_fill(buf + 10, sizeof(buf) - 10); struct istream *is = test_istream_create_data(buf, sizeof(buf)); struct istream *ds = i_stream_create_decrypt_callback(is, no_op_cb, NULL);