<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/object.c, branch v1.7.2</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=v1.7.2</id>
<link rel='self' href='https://git.shady.money/git/atom?h=v1.7.2'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2010-04-20T05:16:35Z</updated>
<entry>
<title>fix "bundle --stdin" segfault</title>
<updated>2010-04-20T05:16:35Z</updated>
<author>
<name>Jonathan Nieder</name>
<email>jrnieder@gmail.com</email>
</author>
<published>2010-04-19T08:03:40Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=97a20eea199f490760cc25b1b7df28361f54e536'/>
<id>urn:sha1:97a20eea199f490760cc25b1b7df28361f54e536</id>
<content type='text'>
When passed an empty list, objects_array_remove_duplicates() corrupts it
by changing the number of entries from 0 to 1.

The problem lies in the condition of its main loop:

	for (ref = 0; ref &lt; array-&gt;nr - 1; ref++) {

The loop body manipulates the supplied object array.  In the case of an
empty array, it should not be doing anything at all.  But array-&gt;nr is an
unsigned quantity, so the code enters the loop, in particular increasing
array-&gt;nr.  Fix this by comparing (ref + 1 &lt; array-&gt;nr) instead.

This bug can be triggered by git bundle --stdin:

	$ echo HEAD | git bundle create some.bundle --stdin’
	Segmentation fault (core dumped)

The list of commits to bundle appears to be empty because of another bug:
by the time the revision-walking machinery gets to look at it, standard
input has already been consumed by rev-list, so this function gets an
empty list of revisions.

After this patch, git bundle --stdin still does not work; it just doesn’t
segfault any more.

Reported-by: Joey Hess &lt;joey@kitenet.net&gt;
Signed-off-by: Jonathan Nieder &lt;jrnieder@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>object.c: remove unused functions</title>
<updated>2010-01-18T06:49:36Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2010-01-12T05:15:12Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=c76189875b35ca04d42df915cd902a33fdbcb9b0'/>
<id>urn:sha1:c76189875b35ca04d42df915cd902a33fdbcb9b0</id>
<content type='text'>
object_list_append() and object_list_length}() are not used anywhere.

Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>object: call "check_sha1_signature" with the replacement sha1</title>
<updated>2009-06-01T00:02:59Z</updated>
<author>
<name>Christian Couder</name>
<email>chriscool@tuxfamily.org</email>
</author>
<published>2009-01-23T09:07:10Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=0e87c36763a384d5bf6fae4bda44fd035c0b75ff'/>
<id>urn:sha1:0e87c36763a384d5bf6fae4bda44fd035c0b75ff</id>
<content type='text'>
Otherwise we get a "sha1 mismatch" error for replaced objects.

Signed-off-by: Christian Couder &lt;chriscool@tuxfamily.org&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Unify signedness in hashing calls</title>
<updated>2009-05-20T07:02:24Z</updated>
<author>
<name>Dan McGee</name>
<email>dpmcgee@gmail.com</email>
</author>
<published>2009-05-19T04:34:02Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=91fe2f909154c5cda3b40c68e72c3172a7f137f6'/>
<id>urn:sha1:91fe2f909154c5cda3b40c68e72c3172a7f137f6</id>
<content type='text'>
Our hash_obj and hashtable_index calls and functions were doing a lot of
funny things with signedness. Unify all of it to 'unsigned int'.

Signed-off-by: Dan McGee &lt;dpmcgee@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Fix type-punning issues</title>
<updated>2009-05-17T05:41:18Z</updated>
<author>
<name>Dan McGee</name>
<email>dpmcgee@gmail.com</email>
</author>
<published>2009-05-12T01:17:38Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=b867d324ceb7e5c4f14a04c6b55d69498812d24b'/>
<id>urn:sha1:b867d324ceb7e5c4f14a04c6b55d69498812d24b</id>
<content type='text'>
In these two places we are casting part of our unsigned char sha1 array into
an unsigned int, which violates GCCs strict-aliasing rules (and probably
other compilers).

Signed-off-by: Dan McGee &lt;dpmcgee@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>bundle: allow the same ref to be given more than once</title>
<updated>2009-01-18T07:00:31Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2009-01-18T06:27:08Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=b2a6d1c6868b6d5e7d2b4fa9129341220a1e848a'/>
<id>urn:sha1:b2a6d1c6868b6d5e7d2b4fa9129341220a1e848a</id>
<content type='text'>
"git bundle create x master master" used to create a bundle that lists
the same branch (master) twice.  Cloning from such a bundle resulted in
a needless warning "warning: Duplicated ref: refs/remotes/origin/master".

Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>parse_object_buffer: don't ignore errors from the object specific parsing functions</title>
<updated>2008-02-04T00:04:57Z</updated>
<author>
<name>Martin Koegler</name>
<email>mkoegler@auto.tuwien.ac.at</email>
</author>
<published>2008-02-03T21:22:39Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=d0b8c9e561ea427104611bf392598a398c18d7cb'/>
<id>urn:sha1:d0b8c9e561ea427104611bf392598a398c18d7cb</id>
<content type='text'>
In the case of an malformed object, the object specific parsing functions
would return an error, which is currently ignored. The object can be partial
initialized in this case.

This patch make parse_object_buffer propagate such errors.

Signed-off-by: Martin Koegler &lt;mkoegler@auto.tuwien.ac.at&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Don't dereference NULL upon lookup failure.</title>
<updated>2007-12-22T19:15:38Z</updated>
<author>
<name>Jim Meyering</name>
<email>meyering@redhat.com</email>
</author>
<published>2007-12-21T10:56:32Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=cc216827936e40bc2e8886623fd44f55e0674932'/>
<id>urn:sha1:cc216827936e40bc2e8886623fd44f55e0674932</id>
<content type='text'>
Instead, signal the error just like the case we do upon encountering
an object with an unknown type.

Signed-off-by: Jim Meyering &lt;meyering@redhat.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Don't assume tree entries that are not dirs are blobs</title>
<updated>2007-06-06T22:43:18Z</updated>
<author>
<name>Sam Vilain</name>
<email>sam.vilain@catalyst.net.nz</email>
</author>
<published>2007-06-06T10:25:17Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=e2ac7cb5fbcf1407003aa07cdcd14141527ea2e3'/>
<id>urn:sha1:e2ac7cb5fbcf1407003aa07cdcd14141527ea2e3</id>
<content type='text'>
When scanning the trees in track_tree_refs() there is a "lazy" test
that assumes that entries are either directories or files.  Don't do
that.

Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'maint-1.5.1' into maint</title>
<updated>2007-05-25T02:01:50Z</updated>
<author>
<name>Junio C Hamano</name>
<email>junkio@cox.net</email>
</author>
<published>2007-05-25T02:01:50Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=76026200eee9fea016c2d87f472bb13cb15f47b2'/>
<id>urn:sha1:76026200eee9fea016c2d87f472bb13cb15f47b2</id>
<content type='text'>
* maint-1.5.1:
  fix memory leak in parse_object when check_sha1_signature fails
  name-rev: tolerate clock skew in committer dates
</content>
</entry>
</feed>
