...
|
...
|
@@ -126,12 +126,22 @@ static const unsigned short mszip_bit_mask_tab[17] = {
|
126
|
126
|
static int mszip_read_input(struct mszip_stream *zip) {
|
127
|
127
|
int nread = zip->read_cb(zip->file, zip->inbuf, (int)zip->inbuf_size);
|
128
|
128
|
if (nread < 0) {
|
129
|
|
- if (zip->file->error == CL_BREAK)
|
130
|
|
- return zip->error = CL_BREAK;
|
|
129
|
+ if (zip->file->error == CL_BREAK) {
|
|
130
|
+ if (nread == zip->last) {
|
|
131
|
+ cli_dbgmsg("mszip_read_input: Two consecutive CL_BREAKs reached.\n");
|
|
132
|
+ return CL_BREAK;
|
|
133
|
+ }
|
|
134
|
+ // Need short circuit to ensure scanning small files
|
|
135
|
+ cli_dbgmsg("mszip_read_input: First CL_BREAK reached.\n");
|
|
136
|
+ zip->i_ptr = zip->i_end;
|
|
137
|
+ zip->last = nread;
|
|
138
|
+ return CL_SUCCESS;
|
|
139
|
+ }
|
131
|
140
|
else
|
132
|
141
|
return zip->error = CL_EFORMAT;
|
133
|
142
|
}
|
134
|
143
|
|
|
144
|
+ zip->last = nread;
|
135
|
145
|
zip->i_ptr = &zip->inbuf[0];
|
136
|
146
|
zip->i_end = &zip->inbuf[nread];
|
137
|
147
|
|