git/list[1] front-page[2] threads[3] people[4] search[5] about
 

unpack_sha1_file issues

From
MWMorten Welinder <mwelinder@gmail.com>
Date
Apr 25, 2005, 02:01 UTC
Message-ID
<118833cc05042419012f425f0d@mail.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
Message 1 of 1 in “unpack_sha1_file issues”
  1. Morten WelinderApr 25, 2005

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.