File: 0002-Fix-AES-encoding-in-corner-case.patch

package info (click to toggle)
libzip 1.5.1-4
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 7,168 kB
  • sloc: ansic: 13,166; perl: 1,056; sh: 133; makefile: 10
file content (23 lines) | stat: -rw-r--r-- 821 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
From: Dieter Baron <dillo@nih.at>
Date: Tue, 12 Mar 2019 11:47:27 +0100
Subject: Fix AES encoding in corner case.

Was triggered when length(compressed data + AES) = n * 8192

Reported by TC in https://github.com/nih-at/libzip/issues/78
---
 lib/zip_source_winzip_aes_encode.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/lib/zip_source_winzip_aes_encode.c b/lib/zip_source_winzip_aes_encode.c
index 12ed1b2..6fabcc3 100644
--- a/lib/zip_source_winzip_aes_encode.c
+++ b/lib/zip_source_winzip_aes_encode.c
@@ -163,6 +163,7 @@ winzip_aes_encrypt(zip_source_t *src, void *ud, void *data, zip_uint64_t length,
 		/* TODO: return partial read? */
 		return -1;
 	    }
+	    buffer_n += _zip_buffer_read(ctx->buffer, data + ret, length - (zip_uint64_t)ret);
 	}
 
 	return (zip_int64_t)(buffer_n + (zip_uint64_t)ret);