Fix potential crash induced by malicious archives; from upstream CVS. CVE-2007-4476, Bugtraq ID 26445