<feed xmlns='http://www.w3.org/2005/Atom'>
<title>user/sven/git.git/mailmap.c, branch v1.7.3.5</title>
<subtitle>Git
</subtitle>
<id>https://git.stealer.net/cgit.cgi/user/sven/git.git/atom?h=v1.7.3.5</id>
<link rel='self' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/atom?h=v1.7.3.5'/>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/'/>
<updated>2010-10-14T02:11:26Z</updated>
<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>
<entry>
<title>Merge branch 'maint'</title>
<updated>2009-04-02T05:46:31Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2009-04-02T05:46:31Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/commit/?id=02c62b10de16515497f1b6fde6278ac531b90f1c'/>
<id>urn:sha1:02c62b10de16515497f1b6fde6278ac531b90f1c</id>
<content type='text'>
* maint:
  Documentation: Remove an odd "instead"
  fix portability problem with IS_RUN_COMMAND_ERR
  mailmap: resurrect lower-casing of email addresses
</content>
</entry>
<entry>
<title>Mailmap: Allow empty email addresses to be mapped</title>
<updated>2009-04-01T22:53:36Z</updated>
<author>
<name>Björn Steinbrink</name>
<email>B.Steinbrink@gmx.de</email>
</author>
<published>2009-03-31T15:30:39Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/commit/?id=5288dd58356e53d61e2b3804fc7d8d23c3a46ab3'/>
<id>urn:sha1:5288dd58356e53d61e2b3804fc7d8d23c3a46ab3</id>
<content type='text'>
While it makes no sense to map some email address to an empty one, doing
things the other way around can be useful. For example when using
filter-branch with an env-filter that employs a mailmap to fix up an
import that created such broken commits with empty email addresses.

Signed-off-by: BjÃ¶rn Steinbrink &lt;B.Steinbrink@gmx.de&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>mailmap: resurrect lower-casing of email addresses</title>
<updated>2009-04-01T18:00:54Z</updated>
<author>
<name>Johannes Schindelin</name>
<email>johannes.schindelin@gmx.de</email>
</author>
<published>2009-03-31T00:18:36Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/commit/?id=bf637803a799451e7feb596422932dd60f0384e1'/>
<id>urn:sha1:bf637803a799451e7feb596422932dd60f0384e1</id>
<content type='text'>
Commit 0925ce4(Add map_user() and clear_mailmap() to mailmap) broke the
lower-casing of email addresses.  This mostly did not matter if your
.mailmap has only lower-case email addresses;  However, we did not
require .mailmap to contain lowercase-only email addresses.

Signed-off-by: Johannes Schindelin &lt;johannes.schindelin@gmx.de&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Add map_user() and clear_mailmap() to mailmap</title>
<updated>2009-02-08T20:36:38Z</updated>
<author>
<name>Marius Storm-Olsen</name>
<email>marius@trolltech.com</email>
</author>
<published>2009-02-08T14:34:29Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/commit/?id=0925ce4d49ef8352617e8f56231bd36802a2f138'/>
<id>urn:sha1:0925ce4d49ef8352617e8f56231bd36802a2f138</id>
<content type='text'>
map_user() allows to lookup and replace both email and
name of a user, based on a new style mailmap file.

The possible mailmap definitions are now:

  proper_name &lt;commit_email&gt;                             # Old style
  &lt;proper_email&gt; &lt;commit_email&gt;                          # New style
  proper_name &lt;proper_email&gt; &lt;commit_email&gt;              # New style
  proper_name &lt;proper_email&gt; commit_name &lt;commit_email&gt;  # New style

map_email() operates the same as before, with the
exception that it also will to try to match on a name
passed in through the name return buffer.

clear_mailmap() is needed to now clear the more complex
mailmap structure.

Signed-off-by: Marius Storm-Olsen &lt;marius@trolltech.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
</feed>
