<feed xmlns='http://www.w3.org/2005/Atom'>
<title>user/sven/git.git/mailmap.c, branch v1.8.0.2</title>
<subtitle>Git
</subtitle>
<id>https://git.stealer.net/cgit.cgi/user/sven/git.git/atom?h=v1.8.0.2</id>
<link rel='self' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/atom?h=v1.8.0.2'/>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/'/>
<updated>2012-10-28T11:50:18Z</updated>
<entry>
<title>mailmap: avoid out-of-bounds memory access</title>
<updated>2012-10-28T11:50:18Z</updated>
<author>
<name>Romain Francoise</name>
<email>romain@orebokech.com</email>
</author>
<published>2012-10-27T22:49:55Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/commit/?id=3174bc5ccfea34717a8dac2175c1951239a4985d'/>
<id>urn:sha1:3174bc5ccfea34717a8dac2175c1951239a4985d</id>
<content type='text'>
AddressSanitizer (http://clang.llvm.org/docs/AddressSanitizer.html)
complains of a one-byte buffer underflow in parse_name_and_email() while
running the test suite. And indeed, if one of the lines in the mailmap
begins with '&lt;', we dereference the address just before the beginning of
the buffer when looking for whitespace to remove, before checking that
we aren't going too far.

So reverse the order of the tests to make sure that we don't read
outside the buffer.

Signed-off-by: Romain Francoise &lt;romain@orebokech.com&gt;
Signed-off-by: Jeff King &lt;peff@peff.net&gt;
</content>
</entry>
<entry>
<title>mailmap: always return a plain mail address from map_user()</title>
<updated>2012-02-06T22:00:06Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2012-02-06T01:31:51Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/commit/?id=f026358ef20e0c252388a41fcc8eff125b00927c'/>
<id>urn:sha1:f026358ef20e0c252388a41fcc8eff125b00927c</id>
<content type='text'>
The callers of map_user() give email and name to it, and expect to get the
up-to-date email and/or name to be used in their output. The function
rewrites the given buffers in place. To optimize the majority of cases,
the function returns 0 when it did not do anything, and it returns 1 when
the caller should use the updated contents.

The 'email' input to the function is terminated by '&gt;' or a NUL (whichever
comes first) for historical reasons, but when a rewrite happens, the value
is replaced with the mailbox inside the &lt;&gt; pair.  However, it failed to
meet this expectation when it only rewrote the name part without rewriting
the email part, and the email in the input was terminated by '&gt;'.

This causes an extra '&gt;' to appear in the output of "blame -e", because the
caller does send in '&gt;'-terminated email, and when the function returned 1
to tell it that rewriting happened, it appends '&gt;' that is necessary when
the email part was rewritten.

The patch looks bigger than it actually is, because this change makes a
variable that points at the end of the email part in the input 'p' live
much longer than it used to, deserving a more descriptive name.

Noticed and diagnosed by Felipe Contreras and Jeff King.

Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'ml/mailmap' into maint-1.7.6</title>
<updated>2011-12-14T05:12:14Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2011-12-14T05:12:14Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/commit/?id=6d1cdadbeeb03f40250526e29b1f1a91582911d8'/>
<id>urn:sha1:6d1cdadbeeb03f40250526e29b1f1a91582911d8</id>
<content type='text'>
* ml/mailmap:
  mailmap: xcalloc mailmap_info

Conflicts:
	mailmap.c
</content>
</entry>
<entry>
<title>mailmap: xcalloc mailmap_info</title>
<updated>2011-11-17T02:00:56Z</updated>
<author>
<name>Marc-André Lureau</name>
<email>marcandre.lureau@gmail.com</email>
</author>
<published>2011-11-17T01:25:06Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/commit/?id=74b531f65feaa09b5c3963f788b437a368933730'/>
<id>urn:sha1:74b531f65feaa09b5c3963f788b437a368933730</id>
<content type='text'>
This is to avoid reaching free of uninitialized members.

With an invalid .mailmap (and perhaps in other cases), it can reach
free(mi-&gt;name) with garbage for example.

Signed-off-by: Marc-André Lureau &lt;marcandre.lureau@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>mailmap: fix use of freed memory</title>
<updated>2010-10-14T02:11:26Z</updated>
<author>
<name>Jim Meyering</name>
<email>jim@meyering.net</email>
</author>
<published>2010-10-11T15:41:16Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/commit/?id=d8d2eb7d6b5e48c2bcb0e71a770f8a05375ac03e'/>
<id>urn:sha1:d8d2eb7d6b5e48c2bcb0e71a770f8a05375ac03e</id>
<content type='text'>
On an x86_64 system (F13-based), I ran these commands in an empty directory:

    git init
    printf '%s\n' \
      '&lt;jdoe@example.com&gt; &lt;jdoe@example.COM&gt;' \
      'John &lt;jdoe@example.com&gt;' &gt; .mailmap
    git shortlog &lt; /dev/null

Here's the result:

    (reading log message from standard input)
    *** glibc detected *** git: free(): invalid pointer: 0x0000000000f53730 ***
    ======= Backtrace: =========
    /lib64/libc.so.6[0x31ba875676]
    git[0x48c2a5]
    git[0x4b9858]
    ...
    zsh: abort (core dumped)  git shortlog

What happened?

Some .mailmap entry is of the &lt;email1&gt; &lt;email2&gt; form,
while a subsequent one looks like "User Name &lt;Email2&gt;,
and the two email addresses on the right are not identical
but are "equal" when using a case-insensitive comparator.

Then, when add_mapping is processing the latter line, new_email is NULL
and we free me-&gt;email, yet do not replace it with a new strdup'd string.
Thus, when later we attempt to use the buffer behind that -&gt;email pointer,
we reference freed memory.

The solution is to free -&gt;email and -&gt;name only if we're about to replace them.

[jc: squashed in the tests from Jonathan]

Signed-off-by: Jim Meyering &lt;meyering@redhat.com&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>string_list: Fix argument order for string_list_lookup</title>
<updated>2010-06-27T17:06:51Z</updated>
<author>
<name>Julian Phillips</name>
<email>julian@quantumfyre.co.uk</email>
</author>
<published>2010-06-25T23:41:37Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/commit/?id=e8c8b7139c87c3e3017d3bff07f91c4349850d58'/>
<id>urn:sha1:e8c8b7139c87c3e3017d3bff07f91c4349850d58</id>
<content type='text'>
Update the definition and callers of string_list_lookup to use the
string_list as the first argument.  This helps make the string_list
API easier to use by being more consistent.

Signed-off-by: Julian Phillips &lt;julian@quantumfyre.co.uk&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>string_list: Fix argument order for string_list_insert_at_index</title>
<updated>2010-06-27T17:06:51Z</updated>
<author>
<name>Julian Phillips</name>
<email>julian@quantumfyre.co.uk</email>
</author>
<published>2010-06-25T23:41:36Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/commit/?id=aadceea641806b363ca555ffdc04109ea716c497'/>
<id>urn:sha1:aadceea641806b363ca555ffdc04109ea716c497</id>
<content type='text'>
Update the definition and callers of string_list_insert_at_index to
use the string_list as the first argument.  This helps make the
string_list API easier to use by being more consistent.

Signed-off-by: Julian Phillips &lt;julian@quantumfyre.co.uk&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>string_list: Fix argument order for string_list_insert</title>
<updated>2010-06-27T17:06:51Z</updated>
<author>
<name>Julian Phillips</name>
<email>julian@quantumfyre.co.uk</email>
</author>
<published>2010-06-25T23:41:35Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/commit/?id=78a395d371ec9fd14297178ec98b8b1042a64fb6'/>
<id>urn:sha1:78a395d371ec9fd14297178ec98b8b1042a64fb6</id>
<content type='text'>
Update the definition and callers of string_list_insert to use the
string_list as the first argument.  This helps make the string_list
API easier to use by being more consistent.

Signed-off-by: Julian Phillips &lt;julian@quantumfyre.co.uk&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>mailmap.c: remove unused function</title>
<updated>2010-01-12T09:06:09Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2010-01-12T05:11:22Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/commit/?id=42b3b0061478f262118036286455a8f09a0d3fff'/>
<id>urn:sha1:42b3b0061478f262118036286455a8f09a0d3fff</id>
<content type='text'>
map_email() is not used anywhere.

Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Fix various sparse warnings in the git source code</title>
<updated>2009-06-21T04:52:55Z</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2009-06-18T17:28:43Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/commit/?id=2af202be3d2f128c6974290cabe13179c6462196'/>
<id>urn:sha1:2af202be3d2f128c6974290cabe13179c6462196</id>
<content type='text'>
There are a few remaining ones, but this fixes the trivial ones. It boils
down to two main issues that sparse complains about:

 - warning: Using plain integer as NULL pointer

   Sparse doesn't like you using '0' instead of 'NULL'. For various good
   reasons, not the least of which is just the visual confusion. A NULL
   pointer is not an integer, and that whole "0 works as NULL" is a
   historical accident and not very pretty.

   A few of these remain: zlib is a total mess, and Z_NULL is just a 0.
   I didn't touch those.

 - warning: symbol 'xyz' was not declared. Should it be static?

   Sparse wants to see declarations for any functions you export. A lack
   of a declaration tends to mean that you should either add one, or you
   should mark the function 'static' to show that it's in file scope.

   A few of these remain: I only did the ones that should obviously just
   be made static.

That 'wt_status_submodule_summary' one is debatable. It has a few related
flags (like 'wt_status_use_color') which _are_ declared, and are used by
builtin-commit.c. So maybe we'd like to export it at some point, but it's
not declared now, and not used outside of that file, so 'static' it is in
this patch.

Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
</feed>
