# unpack_sha1_file issues

1 messages from 2005-04-25 to 2005-04-25. Participants: Morten Welinder.
Thread: https://gitlist.dev/t/303

## Morten Welinder, 2005-04-25 02:01

Subject: unpack_sha1_file issues
Message-ID: <118833cc05042419012f425f0d@mail.gmail.com>
URL: https://gitlist.dev/e/118833cc05042419012f425f0d%40mail.gmail.com

```
unpack_sha1_file is being called by fsck-cache.  Therefore it should
not assume that
a \0 occurs within the first 8192 bytes of the uncompressed data. 
However, currently
both the sscanf and strlen calls do just that.

Also, unpack_sha1_file should call inflateEnd in a couple of the error cases.

Finally, if *size==0, shouldn't unpack_sha1_file allocate a single
byte to prevent
malloc from returning NULL?

Morten

```
