<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/reftable/blocksource.c, branch v2.41.2</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=v2.41.2</id>
<link rel='self' href='https://git.shady.money/git/atom?h=v2.41.2'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2022-05-04T16:51:29Z</updated>
<entry>
<title>Merge branch 'cm/reftable-0-length-memset'</title>
<updated>2022-05-04T16:51:29Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2022-05-04T16:51:29Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=1c4411cce1bfc515cba4c1ca63b7d616e023b5e1'/>
<id>urn:sha1:1c4411cce1bfc515cba4c1ca63b7d616e023b5e1</id>
<content type='text'>
Code clean-up.

* cm/reftable-0-length-memset:
  reftable: avoid undefined behaviour breaking t0032
</content>
</entry>
<entry>
<title>reftable: avoid undefined behaviour breaking t0032</title>
<updated>2022-04-15T16:24:02Z</updated>
<author>
<name>Carlo Marcelo Arenas Belón</name>
<email>carenas@gmail.com</email>
</author>
<published>2022-04-15T08:30:59Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=e6b2582da30b599d95f40510777c643b9fba9012'/>
<id>urn:sha1:e6b2582da30b599d95f40510777c643b9fba9012</id>
<content type='text'>
1214aa841bc (reftable: add blocksource, an abstraction for random
access reads, 2021-10-07), makes the assumption that it is ok to
free a reftable_block pointing to NULL if the size is also set to
0, but implements that using a memset call that at least in glibc
based system will trigger a runtime exception if called with a
NULL pointer as its first parameter.

Avoid doing so by adding a conditional to check for the size in all
three identically looking functions that were affected, and therefore,
still allow memset to help catch callers that might incorrectly pass
a NULL pointer with a non zero size, but avoiding the exception for
the valid cases.

Signed-off-by: Carlo Marcelo Arenas Belón &lt;carenas@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>reftable: fix resource leak blocksource.c</title>
<updated>2022-01-20T19:31:52Z</updated>
<author>
<name>Han-Wen Nienhuys</name>
<email>hanwen@google.com</email>
</author>
<published>2022-01-20T15:12:02Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=27e27ee2249f617b529ac5c9c419d3961885994b'/>
<id>urn:sha1:27e27ee2249f617b529ac5c9c419d3961885994b</id>
<content type='text'>
This would be triggered in the unlikely event of fstat() failing on an
opened file.

Signed-off-by: Han-Wen Nienhuys &lt;hanwen@google.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>reftable: add blocksource, an abstraction for random access reads</title>
<updated>2021-10-08T17:45:48Z</updated>
<author>
<name>Han-Wen Nienhuys</name>
<email>hanwen@google.com</email>
</author>
<published>2021-10-07T20:25:01Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=1214aa841bc825c97541a68f397227cb2bfd3f3c'/>
<id>urn:sha1:1214aa841bc825c97541a68f397227cb2bfd3f3c</id>
<content type='text'>
The reftable format is usually used with files for storage. However, we abstract
away this using the blocksource data structure. This has two advantages:

* log blocks are zlib compressed, and handling them is simplified if we can
  discard byte segments from within the block layer.

* for unittests, it is useful to read and write in-memory. The blocksource
  allows us to abstract the data away from on-disk files.

Signed-off-by: Han-Wen Nienhuys &lt;hanwen@google.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
</feed>
