commit | 8d33958891e148e940c036920783e2e7af057724 | [log] [tgz] |
---|---|---|
author | Thomas Klausner <tk@giga.or.at> | Thu Jan 05 15:45:07 2012 +0100 |
committer | Thomas Klausner <tk@giga.or.at> | Thu Jan 05 15:45:07 2012 +0100 |
tree | 18359d31ad774cef3bd9bfe4f8564144e8b86329 | |
parent | cd559b801251a7ea69077b286ec2ac4ddf3676a5 [diff] [blame] |
Avoid malloc(0). --HG-- branch : HEAD
diff --git a/lib/zip_utf-8.c b/lib/zip_utf-8.c index 5924e3e..f9a771a 100644 --- a/lib/zip_utf-8.c +++ b/lib/zip_utf-8.c
@@ -202,6 +202,9 @@ zip_uint8_t *utf8buf; zip_uint32_t buflen, i, offset; + if (len == 0) + return NULL; + buflen = 0; for (i=0; i<len; i++) buflen += _zip_unicode_to_utf8_len(_cp437_to_unicode[cp437buf[i]]);