threads / discuss / 303

unpack_sha1_file issues

Subject: unpack_sha1_file issues

## tl;dr

One message between Apr 25, 2005 and Apr 25, 2005.

replies: 0people: 1as markdown or json

Morten Welinder· Apr 25, 2005, 02:01 UTC · lore

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

← back to recent threads