|
Link Here
|
| 1 |
--- extract.c.orig 2009-03-14 01:32:52 UTC |
1 |
--- extract.c.orig 2009-03-14 02:32:52.000000000 +0100 |
| 2 |
+++ extract.c |
2 |
+++ extract.c 2016-01-04 14:43:11.813488458 +0100 |
| 3 |
@@ -1,5 +1,5 @@ |
3 |
@@ -1,5 +1,5 @@ |
| 4 |
/* |
4 |
/* |
| 5 |
- Copyright (c) 1990-2009 Info-ZIP. All rights reserved. |
5 |
- Copyright (c) 1990-2009 Info-ZIP. All rights reserved. |
|
Link Here
|
| 7 |
|
7 |
|
| 8 |
See the accompanying file LICENSE, version 2009-Jan-02 or later |
8 |
See the accompanying file LICENSE, version 2009-Jan-02 or later |
| 9 |
(the contents of which are also included in unzip.h) for terms of use. |
9 |
(the contents of which are also included in unzip.h) for terms of use. |
| 10 |
@@ -298,6 +298,8 @@ char ZCONST Far TruncNTSD[] = |
10 |
@@ -298,6 +298,8 @@ |
| 11 |
#ifndef SFX |
11 |
#ifndef SFX |
| 12 |
static ZCONST char Far InconsistEFlength[] = "bad extra-field entry:\n \ |
12 |
static ZCONST char Far InconsistEFlength[] = "bad extra-field entry:\n \ |
| 13 |
EF block length (%u bytes) exceeds remaining EF data (%u bytes)\n"; |
13 |
EF block length (%u bytes) exceeds remaining EF data (%u bytes)\n"; |
|
Link Here
|
| 16 |
static ZCONST char Far InvalidComprDataEAs[] = |
16 |
static ZCONST char Far InvalidComprDataEAs[] = |
| 17 |
" invalid compressed data for EAs\n"; |
17 |
" invalid compressed data for EAs\n"; |
| 18 |
# if (defined(WIN32) && defined(NTSD_EAS)) |
18 |
# if (defined(WIN32) && defined(NTSD_EAS)) |
| 19 |
@@ -2023,7 +2025,8 @@ static int TestExtraField(__G__ ef, ef_l |
19 |
@@ -2023,7 +2025,8 @@ |
| 20 |
ebID = makeword(ef); |
20 |
ebID = makeword(ef); |
| 21 |
ebLen = (unsigned)makeword(ef+EB_LEN); |
21 |
ebLen = (unsigned)makeword(ef+EB_LEN); |
| 22 |
|
22 |
|
|
Link Here
|
| 26 |
/* Discovered some extra field inconsistency! */ |
26 |
/* Discovered some extra field inconsistency! */ |
| 27 |
if (uO.qflag) |
27 |
if (uO.qflag) |
| 28 |
Info(slide, 1, ((char *)slide, "%-22s ", |
28 |
Info(slide, 1, ((char *)slide, "%-22s ", |
| 29 |
@@ -2032,6 +2035,16 @@ static int TestExtraField(__G__ ef, ef_l |
29 |
@@ -2032,6 +2035,16 @@ |
| 30 |
ebLen, (ef_len - EB_HEADSIZE))); |
30 |
ebLen, (ef_len - EB_HEADSIZE))); |
| 31 |
return PK_ERR; |
31 |
return PK_ERR; |
| 32 |
} |
32 |
} |
|
Link Here
|
| 43 |
|
43 |
|
| 44 |
switch (ebID) { |
44 |
switch (ebID) { |
| 45 |
case EF_OS2: |
45 |
case EF_OS2: |
| 46 |
@@ -2217,14 +2230,28 @@ static int test_compr_eb(__G__ eb, eb_si |
46 |
@@ -2217,14 +2230,28 @@ |
| 47 |
ulg eb_ucsize; |
47 |
ulg eb_ucsize; |
| 48 |
uch *eb_ucptr; |
48 |
uch *eb_ucptr; |
| 49 |
int r; |
49 |
int r; |
|
Link Here
|
| 75 |
|
75 |
|
| 76 |
if ( |
76 |
if ( |
| 77 |
#ifdef INT_16BIT |
77 |
#ifdef INT_16BIT |
|
|
78 |
@@ -2701,6 +2728,12 @@ |
| 79 |
int repeated_buf_err; |
| 80 |
bz_stream bstrm; |
| 81 |
|
| 82 |
+ if (G.incnt <= 0 && G.csize <= 0L) { |
| 83 |
+ /* avoid an infinite loop */ |
| 84 |
+ Trace((stderr, "UZbunzip2() got empty input\n")); |
| 85 |
+ return 2; |
| 86 |
+ } |
| 87 |
+ |
| 88 |
#if (defined(DLL) && !defined(NO_SLIDE_REDIR)) |
| 89 |
if (G.redirect_slide) |
| 90 |
wsize = G.redirect_size, redirSlide = G.redirect_buffer; |