<feed xmlns='http://www.w3.org/2005/Atom'>
<title>delta/libgit2.git/src/pack.c, branch cmn/https-cap-no-hardcode</title>
<subtitle>github.com: libgit2/libgit2.git
</subtitle>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/libgit2.git/'/>
<entry>
<title>Fix potential use of uninitialized values</title>
<updated>2016-12-12T08:16:33+00:00</updated>
<author>
<name>Patrick Steinhardt</name>
<email>ps@pks.im</email>
</author>
<published>2016-11-25T14:02:34+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/libgit2.git/commit/?id=34b320535bde5505429f1349fc7d5cc423857a20'/>
<id>34b320535bde5505429f1349fc7d5cc423857a20</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>pack: fix race in pack_entry_find_offset</title>
<updated>2016-11-02T11:23:12+00:00</updated>
<author>
<name>Patrick Steinhardt</name>
<email>ps@pks.im</email>
</author>
<published>2016-11-02T11:23:12+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/libgit2.git/commit/?id=0cf15e39f3d435c6f8d8f52daed2b98c375266a8'/>
<id>0cf15e39f3d435c6f8d8f52daed2b98c375266a8</id>
<content type='text'>
In `pack_entry_find_offset`, we try to find the offset of a
certain object in the pack file. To do so, we first assert if the
packfile has already been opened and open it if not. Opening the
packfile is guarded with a mutex, so concurrent access to this is
in fact safe.

What is not thread-safe though is our calculation of offsets
inside the packfile. Assume two threads calling
`pack_entry_find_offset` at the same time. We first calculate the
offset and index location and only then determine if the pack has
already been opened. If so, we re-calculate the offset and index
address.

Now the case for two threads: thread 1 first calculates the
addresses and is subsequently suspended. The second thread will
now call `pack_index_open` and initialize the pack file,
calculating its addresses correctly. When the first thread is
resumed now, he'll see that the pack file has already been
initialized and will happily proceed with the addresses it has
already calculated before the check. As the pack file was not
initialized before, these addresses are bogus.

Fix the issue by only calculating the addresses after having
checked if the pack file is open.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
In `pack_entry_find_offset`, we try to find the offset of a
certain object in the pack file. To do so, we first assert if the
packfile has already been opened and open it if not. Opening the
packfile is guarded with a mutex, so concurrent access to this is
in fact safe.

What is not thread-safe though is our calculation of offsets
inside the packfile. Assume two threads calling
`pack_entry_find_offset` at the same time. We first calculate the
offset and index location and only then determine if the pack has
already been opened. If so, we re-calculate the offset and index
address.

Now the case for two threads: thread 1 first calculates the
addresses and is subsequently suspended. The second thread will
now call `pack_index_open` and initialize the pack file,
calculating its addresses correctly. When the first thread is
resumed now, he'll see that the pack file has already been
initialized and will happily proceed with the addresses it has
already calculated before the check. As the pack file was not
initialized before, these addresses are bogus.

Fix the issue by only calculating the addresses after having
checked if the pack file is open.
</pre>
</div>
</content>
</entry>
<entry>
<title>delta: move delta application to delta.c</title>
<updated>2016-05-26T18:01:03+00:00</updated>
<author>
<name>Edward Thomson</name>
<email>ethomson@edwardthomson.com</email>
</author>
<published>2015-06-17T13:42:20+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/libgit2.git/commit/?id=6a2d2f8aa14462396cbc7d3e408ed28430e212e2'/>
<id>6a2d2f8aa14462396cbc7d3e408ed28430e212e2</id>
<content type='text'>
Move the delta application functions into `delta.c`, next to the
similar delta creation functions.  Make the `git__delta_apply`
functions adhere to other naming and parameter style within the
library.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Move the delta application functions into `delta.c`, next to the
similar delta creation functions.  Make the `git__delta_apply`
functions adhere to other naming and parameter style within the
library.
</pre>
</div>
</content>
</entry>
<entry>
<title>odb: avoid inflating the full delta to read the header</title>
<updated>2016-05-02T15:37:26+00:00</updated>
<author>
<name>Carlos Martín Nieto</name>
<email>cmn@dwim.me</email>
</author>
<published>2016-04-27T10:00:31+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/libgit2.git/commit/?id=a97b769a0ef7fe8b301c07280c9b80233bb77643'/>
<id>a97b769a0ef7fe8b301c07280c9b80233bb77643</id>
<content type='text'>
When we read the header, we want to know the size and type of the
object. We're currently inflating the full delta in order to read the
first few bytes. This can mean hundreds of kB needlessly inflated for
large objects.

Instead use a packfile stream to read just enough so we can read the two
varints in the header and avoid inflating most of the delta.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
When we read the header, we want to know the size and type of the
object. We're currently inflating the full delta in order to read the
first few bytes. This can mean hundreds of kB needlessly inflated for
large objects.

Instead use a packfile stream to read just enough so we can read the two
varints in the header and avoid inflating most of the delta.
</pre>
</div>
</content>
</entry>
<entry>
<title>Merge pull request #3575 from pmq20/master-13jan16</title>
<updated>2016-03-31T11:12:46+00:00</updated>
<author>
<name>Carlos Martín Nieto</name>
<email>carlosmn@github.com</email>
</author>
<published>2016-03-31T11:12:46+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/libgit2.git/commit/?id=d53cc13e3a66e1b14a249bf48cc30d9fc31e9672'/>
<id>d53cc13e3a66e1b14a249bf48cc30d9fc31e9672</id>
<content type='text'>
Remove duplicated calls to git_mwindow_close</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Remove duplicated calls to git_mwindow_close</pre>
</div>
</content>
</entry>
<entry>
<title>odb: improved not found error messages</title>
<updated>2016-03-07T15:20:01+00:00</updated>
<author>
<name>Edward Thomson</name>
<email>ethomson@github.com</email>
</author>
<published>2016-03-04T06:18:30+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/libgit2.git/commit/?id=e10144ae57e50798e43515cb469722a4e825c23c'/>
<id>e10144ae57e50798e43515cb469722a4e825c23c</id>
<content type='text'>
When looking up an abbreviated oid, show the actual (abbreviated) oid
the caller passed instead of a full (but ambiguously truncated) oid.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
When looking up an abbreviated oid, show the actual (abbreviated) oid
the caller passed instead of a full (but ambiguously truncated) oid.
</pre>
</div>
</content>
</entry>
<entry>
<title>pack: don't allow a negative offset</title>
<updated>2016-02-25T14:46:59+00:00</updated>
<author>
<name>Carlos Martín Nieto</name>
<email>cmn@dwim.me</email>
</author>
<published>2016-02-25T14:46:59+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/libgit2.git/commit/?id=6d97beb91f413f4e90bab76fc7e05495bb0aab70'/>
<id>6d97beb91f413f4e90bab76fc7e05495bb0aab70</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>pack: make sure we don't go out of bounds for extended entries</title>
<updated>2016-02-25T14:43:17+00:00</updated>
<author>
<name>Carlos Martín Nieto</name>
<email>cmn@dwim.me</email>
</author>
<published>2016-02-23T17:15:43+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/libgit2.git/commit/?id=ea9e00cb5ca271b794cca686019d17cc378e23f2'/>
<id>ea9e00cb5ca271b794cca686019d17cc378e23f2</id>
<content type='text'>
A corrupt index might have data that tells us to go look past the end of
the file for data. Catch these cases and return an appropriate error
message.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
A corrupt index might have data that tells us to go look past the end of
the file for data. Catch these cases and return an appropriate error
message.
</pre>
</div>
</content>
</entry>
<entry>
<title>pack: do not free passed in poiter on error</title>
<updated>2016-02-09T08:58:56+00:00</updated>
<author>
<name>Patrick Steinhardt</name>
<email>ps@pks.im</email>
</author>
<published>2016-02-09T08:58:56+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/libgit2.git/commit/?id=a53d2e3985505de0e1dcc580cd2c624fcf0fce93'/>
<id>a53d2e3985505de0e1dcc580cd2c624fcf0fce93</id>
<content type='text'>
The function `git_packfile_stream_open` tries to free the passed
in stream when an error occurs. The only call site is
`git_indexer_append`, though, which passes in the address of a
stream struct which has not been allocated on the heap.

Fix the issue by simply removing the call to free. In case of an
error we did not allocate any memory yet and otherwise it should
be the caller's responsibility to manage it's object's lifetime.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The function `git_packfile_stream_open` tries to free the passed
in stream when an error occurs. The only call site is
`git_indexer_append`, though, which passes in the address of a
stream struct which has not been allocated on the heap.

Fix the issue by simply removing the call to free. In case of an
error we did not allocate any memory yet and otherwise it should
be the caller's responsibility to manage it's object's lifetime.
</pre>
</div>
</content>
</entry>
<entry>
<title>Remove duplicated calls to git_mwindow_close</title>
<updated>2016-01-13T03:07:14+00:00</updated>
<author>
<name>P.S.V.R</name>
<email>pmq2001@gmail.com</email>
</author>
<published>2016-01-13T03:07:14+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/libgit2.git/commit/?id=d4e4f2720407584ca3ecba4704ffeb3c5cbd3702'/>
<id>d4e4f2720407584ca3ecba4704ffeb3c5cbd3702</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
</feed>
