summaryrefslogtreecommitdiff
path: root/libre/unzip/csiz-underflow.patch
diff options
context:
space:
mode:
authorAndré Fabian Silva Delgado <emulatorman@parabola.nu>2015-11-04 00:07:04 -0300
committerAndré Fabian Silva Delgado <emulatorman@parabola.nu>2015-11-04 00:16:36 -0300
commite143bf83e626231284b6872226b7a83111d6fe36 (patch)
tree9e296f66c805b869bf250d3867368377ccc768ab /libre/unzip/csiz-underflow.patch
parent61d267c8d050d81221da8c3f935c79700f81c869 (diff)
downloadabslibre-e143bf83e626231284b6872226b7a83111d6fe36.tar.gz
abslibre-e143bf83e626231284b6872226b7a83111d6fe36.tar.bz2
abslibre-e143bf83e626231284b6872226b7a83111d6fe36.zip
unzip-6.0-11.parabola1: fix FS#46955 -> https://bugs.archlinux.org/task/46955
Diffstat (limited to 'libre/unzip/csiz-underflow.patch')
-rw-r--r--libre/unzip/csiz-underflow.patch32
1 files changed, 32 insertions, 0 deletions
diff --git a/libre/unzip/csiz-underflow.patch b/libre/unzip/csiz-underflow.patch
new file mode 100644
index 000000000..52321c208
--- /dev/null
+++ b/libre/unzip/csiz-underflow.patch
@@ -0,0 +1,32 @@
+From: Kamil Dudka <kdudka@redhat.com>
+Date: Tue, 22 Sep 2015 18:52:23 +0200
+Subject: [PATCH] extract: prevent unsigned overflow on invalid input
+Origin: other, https://bugzilla.redhat.com/attachment.cgi?id=1075942
+Bug-RedHat: https://bugzilla.redhat.com/show_bug.cgi?id=1260944
+
+Suggested-by: Stefan Cornelius
+---
+ extract.c | 11 ++++++++++-
+ 1 file changed, 10 insertions(+), 1 deletion(-)
+
+--- a/extract.c
++++ b/extract.c
+@@ -1257,8 +1257,17 @@
+ if (G.lrec.compression_method == STORED) {
+ zusz_t csiz_decrypted = G.lrec.csize;
+
+- if (G.pInfo->encrypted)
++ if (G.pInfo->encrypted) {
++ if (csiz_decrypted <= 12) {
++ /* handle the error now to prevent unsigned overflow */
++ Info(slide, 0x401, ((char *)slide,
++ LoadFarStringSmall(ErrUnzipNoFile),
++ LoadFarString(InvalidComprData),
++ LoadFarStringSmall2(Inflate)));
++ return PK_ERR;
++ }
+ csiz_decrypted -= 12;
++ }
+ if (G.lrec.ucsize != csiz_decrypted) {
+ Info(slide, 0x401, ((char *)slide,
+ LoadFarStringSmall2(WrnStorUCSizCSizDiff),