git-svn: trunk@1762
Tomasz Kojm authored on 2005/11/17 03:26:42... | ... |
@@ -430,10 +430,17 @@ __zzip_parse_root_directory(int fd, |
430 | 430 |
} |
431 | 431 |
hdr->d_compr = (uint8_t)ZZIP_GET16(d->z_compr); |
432 | 432 |
|
433 |
+ /* If d_compr is incorrect scanning will result in CL_EZIP (Zip |
|
434 |
+ * module failure) |
|
435 |
+ */ |
|
433 | 436 |
if(!hdr->d_compr && hdr->d_csize != hdr->d_usize) { |
434 | 437 |
cli_dbgmsg("Zziplib: File claims to be stored but csize != usize\n"); |
435 | 438 |
cli_dbgmsg("Zziplib: Switching to the inflate method\n"); |
436 | 439 |
hdr->d_compr = 8; |
440 |
+ } else if(hdr->d_compr && hdr->d_csize == hdr->d_usize) { |
|
441 |
+ cli_dbgmsg("Zziplib: File claims to be deflated but csize == usize\n"); |
|
442 |
+ cli_dbgmsg("Zziplib: Switching to the stored method\n"); |
|
443 |
+ hdr->d_compr = 0; |
|
437 | 444 |
} |
438 | 445 |
|
439 | 446 |
hdr->d_flags = u_flags; |