Bug 3780 - Upgrade unzip.c from version 0.01 alpha to 1.01e
Status: RESOLVED FIXED
Alias: None
Product: ioquake3
Classification: Unclassified
Component: Platform
Version: GIT MASTER
Hardware: All All
: P3 enhancement
Assignee: Zachary J. Slater
QA Contact: ioquake3 bugzilla mailing list
URL:
Depends on:
Blocks:
 
Reported: 2008-09-15 05:15 EDT by Amanieu d'Antras
Modified: 2009-10-19 12:18:32 EDT
2 users (show)

See Also:


Attachments
Patch based on svn 1470 (303.51 KB, patch)
2008-09-15 05:19 EDT, Amanieu d'Antras
code/libs/win32/libz.a (75.72 KB, application/octet-stream)
2008-09-15 05:20 EDT, Amanieu d'Antras
Integrate the unzip part of zlib directly into the source tree like libspeex (415.59 KB, patch)
2008-09-16 10:02 EDT, Amanieu d'Antras

Description Amanieu d'Antras 2008-09-15 05:15:49 EDT
This patch will upgrade the unzip code to the latest version. The only downside is that it adds an external dependancy for zlib, but that isn't too much of a problem since it is present on most systems. I also provide a prebuilt static library of zlib for windows systems because they don't have it.
Comment 1 Amanieu d'Antras 2008-09-15 05:19:39 EDT
Created attachment 1867 [details]
Patch based on svn 1470
Comment 2 Amanieu d'Antras 2008-09-15 05:20:21 EDT
Created attachment 1868 [details]
code/libs/win32/libz.a
Comment 3 Amanieu d'Antras 2008-09-15 22:15:12 EDT
Apparently it still requires zlib1.dll on Windows, but only in some cases. I'm going to integrate zlib directly into the code.
Comment 4 Amanieu d'Antras 2008-09-16 10:02:23 EDT
Created attachment 1869 [details]
Integrate the unzip part of zlib directly into the source tree like libspeex
Comment 5 Ludwig Nussel 2008-11-02 11:22:52 EST
what'st the benefit of doing that?
Comment 6 Ryan C. Gordon 2009-09-14 12:00:56 EDT
I suppose the benefit is that our existing copy unzip.c appears to contain a cut-and-paste of most of zlib 1.1.3, which has known bugs:

  zlib Compression Library Corrupts malloc Data Structures via Double Free:
    http://zlib.net/advisory-2002-03-11.txt

  zlib inflate() routine vulnerable to buffer overflow:
    http://www.kb.cert.org/vuls/id/680620

  The zlib compression library is vulnerable to a denial-of-service condition:
    http://www.kb.cert.org/vuls/id/238678

...so theoretically a malicious pk3 file downloaded from a server could own your box.

This might be worth doing.   :/

--ryan.
Comment 7 Thilo Schulz 2009-10-19 12:18:32 EDT
Thank you for this patch, it was helpful in doing all of this. check r1681-r1683