<feed xmlns='http://www.w3.org/2005/Atom'>
<title>cgit/parsing.c, branch ch/git-2-56</title>
<subtitle>ui for git.eugenetriguba.com
</subtitle>
<link rel='alternate' type='text/html' href='https://git.eugenetriguba.com/forks/cgit/'/>
<entry>
<title>global: fix libc constness warnings</title>
<updated>2026-05-04T21:03:51+00:00</updated>
<author>
<name>Jason A. Donenfeld</name>
<email>Jason@zx2c4.com</email>
</author>
<published>2026-05-04T21:03:22+00:00</published>
<link rel='alternate' type='text/html' href='https://git.eugenetriguba.com/forks/cgit/commit/?id=5a0f900569f421422bd7511a45c7346c7668e710'/>
<id>5a0f900569f421422bd7511a45c7346c7668e710</id>
<content type='text'>
Signed-off-by: Jason A. Donenfeld &lt;Jason@zx2c4.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Signed-off-by: Jason A. Donenfeld &lt;Jason@zx2c4.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>git: update to v2.51.1</title>
<updated>2025-10-16T07:49:45+00:00</updated>
<author>
<name>Christian Hesse</name>
<email>mail@eworm.de</email>
</author>
<published>2025-10-16T07:25:33+00:00</published>
<link rel='alternate' type='text/html' href='https://git.eugenetriguba.com/forks/cgit/commit/?id=883304cb0ec4d27df33008f945e81174c26baa30'/>
<id>883304cb0ec4d27df33008f945e81174c26baa30</id>
<content type='text'>
Update to git version v2.51.1, this requires changes for these
upstream commits:

* e1d062e8ba0b72f49e9ef9713cc7011c330baab8
  odb: drop deprecated wrapper functions

Signed-off-by: Christian Hesse &lt;mail@eworm.de&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Update to git version v2.51.1, this requires changes for these
upstream commits:

* e1d062e8ba0b72f49e9ef9713cc7011c330baab8
  odb: drop deprecated wrapper functions

Signed-off-by: Christian Hesse &lt;mail@eworm.de&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>git: update to v2.46.0</title>
<updated>2024-08-02T16:22:56+00:00</updated>
<author>
<name>Christian Hesse</name>
<email>mail@eworm.de</email>
</author>
<published>2024-07-16T07:45:13+00:00</published>
<link rel='alternate' type='text/html' href='https://git.eugenetriguba.com/forks/cgit/commit/?id=09d24d7cd0b7e85633f2f43808b12871bb209d69'/>
<id>09d24d7cd0b7e85633f2f43808b12871bb209d69</id>
<content type='text'>
Update to git version v2.46.0, this requires changes for these
upstream commits:

* e7da9385708accf518a80a1e17969020fb361048
  global: introduce `USE_THE_REPOSITORY_VARIABLE` macro

* 9da95bda74cf10e1475384a71fd20914c3b99784
  hash: require hash algorithm in `oidread()` and `oidclr()`

* 30aaff437fddd889ba429b50b96ea4c151c502c5
  refs: pass repo when peeling objects

* c8f815c2083c4b340d4148a15d45c55f2fcc7d3f
  refs: remove functions without ref store

Signed-off-by: Christian Hesse &lt;mail@eworm.de&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Update to git version v2.46.0, this requires changes for these
upstream commits:

* e7da9385708accf518a80a1e17969020fb361048
  global: introduce `USE_THE_REPOSITORY_VARIABLE` macro

* 9da95bda74cf10e1475384a71fd20914c3b99784
  hash: require hash algorithm in `oidread()` and `oidclr()`

* 30aaff437fddd889ba429b50b96ea4c151c502c5
  refs: pass repo when peeling objects

* c8f815c2083c4b340d4148a15d45c55f2fcc7d3f
  refs: remove functions without ref store

Signed-off-by: Christian Hesse &lt;mail@eworm.de&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>git: update to v2.41.0</title>
<updated>2023-06-01T10:00:43+00:00</updated>
<author>
<name>Christian Hesse</name>
<email>mail@eworm.de</email>
</author>
<published>2023-05-16T15:02:27+00:00</published>
<link rel='alternate' type='text/html' href='https://git.eugenetriguba.com/forks/cgit/commit/?id=a6da40bf84527cbe77d1ec504e1fefb982b9a52a'/>
<id>a6da40bf84527cbe77d1ec504e1fefb982b9a52a</id>
<content type='text'>
Update to git version v2.41.0, with lots of changes...
This requires changes for these upstream commits:

* 60ff56f50372c1498718938ef504e744fe011ffb
  banned.h: mark `strtok()` and `strtok_r()` as banned

* 52acddf36c8cb3778ab2098a0d95cc2e375a4069
  string-list: multi-delimiter `string_list_split_in_place()`

* d850b7a545fcfbd97460a921c7f7c59d933eb0f7
  cocci: apply the "cache.h" part of "the_repository.pending"

* cb338c23d6d518947bf6f7240bf30e2ec232bd3b
  cocci: apply the "commit-reach.h" part of "the_repository.pending"

* ecb5091fd4301ac647db0bd2504112b38f7ee06d
  cocci: apply the "commit.h" part of "the_repository.pending"

* 085390328f5fe1dfba67039b1fd6cc51546a4e41
  cocci: apply the "diff.h" part of "the_repository.pending"

* bc726bd075929aab6b3e09d4dd5c2b0726fd5350
  cocci: apply the "object-store.h" part of "the_repository.pending"

* bab821646a74c446370fa8d01ca851f247df5033
  cocci: apply the "pretty.h" part of "the_repository.pending"

* afe27c889429438829bc8818ed17e4960bd3ef02
  cocci: apply the "packfile.h" part of "the_repository.pending"

* 12cb1c10a64170a5d600dd1c6c8abfeec105fb6b
  cocci: apply the "refs.h" part of "the_repository.pending"

* 035c7de9e9ea11d26df5f9e4bb117f91ed11a9fd
  cocci: apply the "revision.h" part of "the_repository.pending"

... and some more I missed to list 😜 - for example the move and cleanup
of headers and includes (see changes in `cgit.h`) comes to mind...

Signed-off-by: Christian Hesse &lt;mail@eworm.de&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Update to git version v2.41.0, with lots of changes...
This requires changes for these upstream commits:

* 60ff56f50372c1498718938ef504e744fe011ffb
  banned.h: mark `strtok()` and `strtok_r()` as banned

* 52acddf36c8cb3778ab2098a0d95cc2e375a4069
  string-list: multi-delimiter `string_list_split_in_place()`

* d850b7a545fcfbd97460a921c7f7c59d933eb0f7
  cocci: apply the "cache.h" part of "the_repository.pending"

* cb338c23d6d518947bf6f7240bf30e2ec232bd3b
  cocci: apply the "commit-reach.h" part of "the_repository.pending"

* ecb5091fd4301ac647db0bd2504112b38f7ee06d
  cocci: apply the "commit.h" part of "the_repository.pending"

* 085390328f5fe1dfba67039b1fd6cc51546a4e41
  cocci: apply the "diff.h" part of "the_repository.pending"

* bc726bd075929aab6b3e09d4dd5c2b0726fd5350
  cocci: apply the "object-store.h" part of "the_repository.pending"

* bab821646a74c446370fa8d01ca851f247df5033
  cocci: apply the "pretty.h" part of "the_repository.pending"

* afe27c889429438829bc8818ed17e4960bd3ef02
  cocci: apply the "packfile.h" part of "the_repository.pending"

* 12cb1c10a64170a5d600dd1c6c8abfeec105fb6b
  cocci: apply the "refs.h" part of "the_repository.pending"

* 035c7de9e9ea11d26df5f9e4bb117f91ed11a9fd
  cocci: apply the "revision.h" part of "the_repository.pending"

... and some more I missed to list 😜 - for example the move and cleanup
of headers and includes (see changes in `cgit.h`) comes to mind...

Signed-off-by: Christian Hesse &lt;mail@eworm.de&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>global: replace hard coded hash length</title>
<updated>2020-10-20T21:57:12+00:00</updated>
<author>
<name>Christian Hesse</name>
<email>mail@eworm.de</email>
</author>
<published>2020-10-20T21:46:09+00:00</published>
<link rel='alternate' type='text/html' href='https://git.eugenetriguba.com/forks/cgit/commit/?id=a4de0e810b69710c3b32f6d253d80d16dec09f36'/>
<id>a4de0e810b69710c3b32f6d253d80d16dec09f36</id>
<content type='text'>
With sha1 we had a guaranteed length of 40 hex chars. This changes now
that we have to support sha256 with 64 hex chars... Support both.

Signed-off-by: Christian Hesse &lt;mail@eworm.de&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
With sha1 we had a guaranteed length of 40 hex chars. This changes now
that we have to support sha256 with 64 hex chars... Support both.

Signed-off-by: Christian Hesse &lt;mail@eworm.de&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>global: replace references to 'sha1' with 'oid'</title>
<updated>2020-10-20T21:57:12+00:00</updated>
<author>
<name>Christian Hesse</name>
<email>mail@eworm.de</email>
</author>
<published>2020-10-20T21:32:45+00:00</published>
<link rel='alternate' type='text/html' href='https://git.eugenetriguba.com/forks/cgit/commit/?id=779631c6dc23c15bbbf45a7c7ab9fffb619037b7'/>
<id>779631c6dc23c15bbbf45a7c7ab9fffb619037b7</id>
<content type='text'>
For some time now sha1 is considered broken and upstream is working to
replace it with sha256. Replace all references to 'sha1' with 'oid',
just as upstream does.

Signed-off-by: Christian Hesse &lt;mail@eworm.de&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
For some time now sha1 is considered broken and upstream is working to
replace it with sha256. Replace all references to 'sha1' with 'oid',
just as upstream does.

Signed-off-by: Christian Hesse &lt;mail@eworm.de&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>git: update to v2.24.0</title>
<updated>2019-11-08T21:55:58+00:00</updated>
<author>
<name>Christian Hesse</name>
<email>mail@eworm.de</email>
</author>
<published>2019-10-23T21:21:54+00:00</published>
<link rel='alternate' type='text/html' href='https://git.eugenetriguba.com/forks/cgit/commit/?id=bfabd4519c80f39eedba3dd5d522563899e364c9'/>
<id>bfabd4519c80f39eedba3dd5d522563899e364c9</id>
<content type='text'>
Update to git version v2.24.0.

Never use get_cached_commit_buffer() directly, use repo_get_commit_buffer()
instead. The latter calls the former anyway. This fixes segmentation fault
when commit-graph is enabled and get_cached_commit_buffer() does not return
the expected result.

Signed-off-by: Christian Hesse &lt;mail@eworm.de&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Update to git version v2.24.0.

Never use get_cached_commit_buffer() directly, use repo_get_commit_buffer()
instead. The latter calls the former anyway. This fixes segmentation fault
when commit-graph is enabled and get_cached_commit_buffer() does not return
the expected result.

Signed-off-by: Christian Hesse &lt;mail@eworm.de&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>git: update to v2.19.1</title>
<updated>2018-10-12T21:06:02+00:00</updated>
<author>
<name>Christian Hesse</name>
<email>mail@eworm.de</email>
</author>
<published>2018-08-28T16:27:00+00:00</published>
<link rel='alternate' type='text/html' href='https://git.eugenetriguba.com/forks/cgit/commit/?id=2c9f56f3e1c754f60ccffbc6c745b9d5a81ea005'/>
<id>2c9f56f3e1c754f60ccffbc6c745b9d5a81ea005</id>
<content type='text'>
Update to git version v2.19.1. Required changes follow upstream commits:

* commit: add repository argument to get_cached_commit_buffer
  (3ce85f7e5a41116145179f0fae2ce6d86558d099)

* commit: add repository argument to lookup_commit_reference
  (2122f6754c93be8f02bfb5704ed96c88fc9837a8)

* object: add repository argument to parse_object
  (109cd76dd3467bd05f8d2145b857006649741d5c)

* tag: add repository argument to deref_tag
  (a74093da5ed601a09fa158e5ba6f6f14c1142a3e)

* tag: add repository argument to lookup_tag
  (ce71efb713f97f476a2d2ab541a0c73f684a5db3)

* tree: add repository argument to lookup_tree
  (f86bcc7b2ce6cad68ba1a48a528e380c6126705e)

* archive.c: avoid access to the_index
  (b612ee202a48f129f81f8f6a5af6cf71d1a9caef)

* for_each_*_object: move declarations to object-store.h
  (0889aae1cd18c1804ba01c1a4229e516dfb9fe9b)

Signed-off-by: Christian Hesse &lt;mail@eworm.de&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Update to git version v2.19.1. Required changes follow upstream commits:

* commit: add repository argument to get_cached_commit_buffer
  (3ce85f7e5a41116145179f0fae2ce6d86558d099)

* commit: add repository argument to lookup_commit_reference
  (2122f6754c93be8f02bfb5704ed96c88fc9837a8)

* object: add repository argument to parse_object
  (109cd76dd3467bd05f8d2145b857006649741d5c)

* tag: add repository argument to deref_tag
  (a74093da5ed601a09fa158e5ba6f6f14c1142a3e)

* tag: add repository argument to lookup_tag
  (ce71efb713f97f476a2d2ab541a0c73f684a5db3)

* tree: add repository argument to lookup_tree
  (f86bcc7b2ce6cad68ba1a48a528e380c6126705e)

* archive.c: avoid access to the_index
  (b612ee202a48f129f81f8f6a5af6cf71d1a9caef)

* for_each_*_object: move declarations to object-store.h
  (0889aae1cd18c1804ba01c1a4229e516dfb9fe9b)

Signed-off-by: Christian Hesse &lt;mail@eworm.de&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>parsing: ban sprintf()</title>
<updated>2018-09-11T06:47:12+00:00</updated>
<author>
<name>Christian Hesse</name>
<email>mail@eworm.de</email>
</author>
<published>2018-08-28T16:14:32+00:00</published>
<link rel='alternate' type='text/html' href='https://git.eugenetriguba.com/forks/cgit/commit/?id=60a930044d57faae4fcb84cba9d85310b0c767a7'/>
<id>60a930044d57faae4fcb84cba9d85310b0c767a7</id>
<content type='text'>
Git upstream bans sprintf() with commit:

  banned.h: mark sprintf() as banned
  cc8fdaee1eeaf05d8dd55ff11f111b815f673c58

Signed-off-by: Christian Hesse &lt;mail@eworm.de&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Git upstream bans sprintf() with commit:

  banned.h: mark sprintf() as banned
  cc8fdaee1eeaf05d8dd55ff11f111b815f673c58

Signed-off-by: Christian Hesse &lt;mail@eworm.de&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>parsing: ban strncpy()</title>
<updated>2018-09-11T06:47:12+00:00</updated>
<author>
<name>Christian Hesse</name>
<email>mail@eworm.de</email>
</author>
<published>2018-08-28T16:11:50+00:00</published>
<link rel='alternate' type='text/html' href='https://git.eugenetriguba.com/forks/cgit/commit/?id=7cde5885d8ce53359ee665bb930b1da956e8369a'/>
<id>7cde5885d8ce53359ee665bb930b1da956e8369a</id>
<content type='text'>
Git upstream bans strncpy() with commit:

  banned.h: mark strncpy() as banned
  e488b7aba743d23b830d239dcc33d9ca0745a9ad

Signed-off-by: Christian Hesse &lt;mail@eworm.de&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Git upstream bans strncpy() with commit:

  banned.h: mark strncpy() as banned
  e488b7aba743d23b830d239dcc33d9ca0745a9ad

Signed-off-by: Christian Hesse &lt;mail@eworm.de&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>git: update to v2.18.0</title>
<updated>2018-06-27T16:13:03+00:00</updated>
<author>
<name>Christian Hesse</name>
<email>mail@eworm.de</email>
</author>
<published>2018-06-04T16:49:28+00:00</published>
<link rel='alternate' type='text/html' href='https://git.eugenetriguba.com/forks/cgit/commit/?id=255b78ff5291cef79978b025c9872f801de89e23'/>
<id>255b78ff5291cef79978b025c9872f801de89e23</id>
<content type='text'>
Update to git version v2.18.0. Required changes follow upstream commits:

* Convert find_unique_abbrev* to struct object_id
  (aab9583f7b5ea5463eb3f653a0b4ecac7539dc94)
* sha1_file: convert read_sha1_file to struct object_id
  (b4f5aca40e6f77cbabcbf4ff003c3cf30a1830c8)
* sha1_file: convert sha1_object_info* to object_id
  (abef9020e3df87c441c9a3a95f592fce5fa49bb9)
* object-store: move packed_git and packed_git_mru to object store
  (a80d72db2a73174b3f22142eb2014b33696fd795)
* treewide: rename tree to maybe_tree
  (891435d55da80ca3654b19834481205be6bdfe33)

The changed data types required some of our own functions to be converted
to struct object_id:

  ls_item
  print_dir
  print_dir_entry
  print_object
  single_tree_cb
  walk_tree
  write_tree_link

And finally we use new upstream functions that were added for
struct object_id:

  hashcpy     -&gt; oidcpy
  sha1_to_hex -&gt; oid_to_hex

Signed-off-by: Christian Hesse &lt;mail@eworm.de&gt;
Reviewed-by: John Keeping &lt;john@keeping.me.uk&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Update to git version v2.18.0. Required changes follow upstream commits:

* Convert find_unique_abbrev* to struct object_id
  (aab9583f7b5ea5463eb3f653a0b4ecac7539dc94)
* sha1_file: convert read_sha1_file to struct object_id
  (b4f5aca40e6f77cbabcbf4ff003c3cf30a1830c8)
* sha1_file: convert sha1_object_info* to object_id
  (abef9020e3df87c441c9a3a95f592fce5fa49bb9)
* object-store: move packed_git and packed_git_mru to object store
  (a80d72db2a73174b3f22142eb2014b33696fd795)
* treewide: rename tree to maybe_tree
  (891435d55da80ca3654b19834481205be6bdfe33)

The changed data types required some of our own functions to be converted
to struct object_id:

  ls_item
  print_dir
  print_dir_entry
  print_object
  single_tree_cb
  walk_tree
  write_tree_link

And finally we use new upstream functions that were added for
struct object_id:

  hashcpy     -&gt; oidcpy
  sha1_to_hex -&gt; oid_to_hex

Signed-off-by: Christian Hesse &lt;mail@eworm.de&gt;
Reviewed-by: John Keeping &lt;john@keeping.me.uk&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>parsing: don't clear existing state with empty input</title>
<updated>2017-10-14T12:31:18+00:00</updated>
<author>
<name>John Keeping</name>
<email>john@keeping.me.uk</email>
</author>
<published>2017-10-14T12:02:53+00:00</published>
<link rel='alternate' type='text/html' href='https://git.eugenetriguba.com/forks/cgit/commit/?id=9d751e7eec4f4bc7292be46f2af774fe1adf336a'/>
<id>9d751e7eec4f4bc7292be46f2af774fe1adf336a</id>
<content type='text'>
Since commit c699866 (parsing: clear query path before starting,
2017-02-19), we clear the "page" variable simply by calling
cgit_parse_url() even if the URL is empty.  This breaks a URL like:

	.../cgit?p=about

which is generated when using the "root-readme" configuration option.

This happens because "page" is set to "about" when parsing the query
string before we handle the path (which is empty, but non-null).

It turns out that this is not the only case which is broken, but
specifying repository and page via query options has been broken since
before the commit mentioned above, for example:

	.../cgit?r=git&amp;p=log

Fix both of these by allowing the previous state to persist if PATH_INFO
is empty, falling back to the query parameters if no path has been
requested.

Reported-by: Tom Ryder &lt;tom@sanctum.geek.nz&gt;
Signed-off-by: John Keeping &lt;john@keeping.me.uk&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Since commit c699866 (parsing: clear query path before starting,
2017-02-19), we clear the "page" variable simply by calling
cgit_parse_url() even if the URL is empty.  This breaks a URL like:

	.../cgit?p=about

which is generated when using the "root-readme" configuration option.

This happens because "page" is set to "about" when parsing the query
string before we handle the path (which is empty, but non-null).

It turns out that this is not the only case which is broken, but
specifying repository and page via query options has been broken since
before the commit mentioned above, for example:

	.../cgit?r=git&amp;p=log

Fix both of these by allowing the previous state to persist if PATH_INFO
is empty, falling back to the query parameters if no path has been
requested.

Reported-by: Tom Ryder &lt;tom@sanctum.geek.nz&gt;
Signed-off-by: John Keeping &lt;john@keeping.me.uk&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>parsing: clear query path before starting</title>
<updated>2017-08-10T14:05:07+00:00</updated>
<author>
<name>John Keeping</name>
<email>john@keeping.me.uk</email>
</author>
<published>2017-02-19T12:17:05+00:00</published>
<link rel='alternate' type='text/html' href='https://git.eugenetriguba.com/forks/cgit/commit/?id=c699866699411346c5dba406457581013f85a873'/>
<id>c699866699411346c5dba406457581013f85a873</id>
<content type='text'>
By specifying the "url" query parameter multiple times it is possible to
end up with ctx.qry.vpath set while ctx.repo is null, which triggers an
invalid code path from cgit_print_pageheader() while printing path
crumbs, resulting in a null dereference.

The previous patch fixed this segfault, but it makes no sense for us to
clear ctx.repo while leaving ctx.qry.path set to the previous value, so
let's just clear it here so that the last "url" parameter given takes
full effect rather than partially overriding the effect of the previous
value.

Signed-off-by: John Keeping &lt;john@keeping.me.uk&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
By specifying the "url" query parameter multiple times it is possible to
end up with ctx.qry.vpath set while ctx.repo is null, which triggers an
invalid code path from cgit_print_pageheader() while printing path
crumbs, resulting in a null dereference.

The previous patch fixed this segfault, but it makes no sense for us to
clear ctx.repo while leaving ctx.qry.path set to the previous value, so
let's just clear it here so that the last "url" parameter given takes
full effect rather than partially overriding the effect of the previous
value.

Signed-off-by: John Keeping &lt;john@keeping.me.uk&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>parsing: add timezone to ident structures</title>
<updated>2016-02-08T13:20:08+00:00</updated>
<author>
<name>John Keeping</name>
<email>john@keeping.me.uk</email>
</author>
<published>2016-01-19T19:33:02+00:00</published>
<link rel='alternate' type='text/html' href='https://git.eugenetriguba.com/forks/cgit/commit/?id=45c87ca1c32dcd5ffd4a681fadf05627d9ce7770'/>
<id>45c87ca1c32dcd5ffd4a681fadf05627d9ce7770</id>
<content type='text'>
This will allow us to mimic Git's behaviour of showing times in the
originator's timezone when displaying commits and tags.

Signed-off-by: John Keeping &lt;john@keeping.me.uk&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This will allow us to mimic Git's behaviour of showing times in the
originator's timezone when displaying commits and tags.

Signed-off-by: John Keeping &lt;john@keeping.me.uk&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>git: update to v2.7.0</title>
<updated>2016-01-13T16:12:17+00:00</updated>
<author>
<name>Christian Hesse</name>
<email>mail@eworm.de</email>
</author>
<published>2016-01-05T06:38:53+00:00</published>
<link rel='alternate' type='text/html' href='https://git.eugenetriguba.com/forks/cgit/commit/?id=559ab5ecc4445c8477ecf62c9fc97efa412dd562'/>
<id>559ab5ecc4445c8477ecf62c9fc97efa412dd562</id>
<content type='text'>
Update to git version v2.7.0.

* Upstream commit ed1c9977cb1b63e4270ad8bdf967a2d02580aa08 (Remove
  get_object_hash.) changed API:

  Convert all instances of get_object_hash to use an appropriate
  reference to the hash member of the oid member of struct object.
  This provides no functional change, as it is essentially a macro
  substitution.

Signed-off-by: Christian Hesse &lt;mail@eworm.de&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Update to git version v2.7.0.

* Upstream commit ed1c9977cb1b63e4270ad8bdf967a2d02580aa08 (Remove
  get_object_hash.) changed API:

  Convert all instances of get_object_hash to use an appropriate
  reference to the hash member of the oid member of struct object.
  This provides no functional change, as it is essentially a macro
  substitution.

Signed-off-by: Christian Hesse &lt;mail@eworm.de&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Drop return value from parse_user()</title>
<updated>2015-03-05T14:54:47+00:00</updated>
<author>
<name>Lukas Fleischer</name>
<email>cgit@cryptocrack.de</email>
</author>
<published>2015-03-05T11:58:12+00:00</published>
<link rel='alternate' type='text/html' href='https://git.eugenetriguba.com/forks/cgit/commit/?id=3cb8e762780cb4bd8dc9d330d549e36d65ad4335'/>
<id>3cb8e762780cb4bd8dc9d330d549e36d65ad4335</id>
<content type='text'>
In commit 936295c (Simplify commit and tag parsing, 2015-03-03), the
commit and tag parsing code was refactored. This broke tag messages in
ui-tag since the line after the tagger header was erroneously skipped.
Rework parse_user() and skip the line manually outside parse_user().

Signed-off-by: Lukas Fleischer &lt;cgit@cryptocrack.de&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
In commit 936295c (Simplify commit and tag parsing, 2015-03-03), the
commit and tag parsing code was refactored. This broke tag messages in
ui-tag since the line after the tagger header was erroneously skipped.
Rework parse_user() and skip the line manually outside parse_user().

Signed-off-by: Lukas Fleischer &lt;cgit@cryptocrack.de&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Remove leading newline characters from tag messages</title>
<updated>2015-03-05T14:54:34+00:00</updated>
<author>
<name>Lukas Fleischer</name>
<email>cgit@cryptocrack.de</email>
</author>
<published>2015-03-05T11:58:11+00:00</published>
<link rel='alternate' type='text/html' href='https://git.eugenetriguba.com/forks/cgit/commit/?id=4d8ed337cb07121cdd6d0041565cf741a9be526a'/>
<id>4d8ed337cb07121cdd6d0041565cf741a9be526a</id>
<content type='text'>
Fixes a regression introduced in commit 936295c (Simplify commit and tag
parsing, 2015-03-03).

Signed-off-by: Lukas Fleischer &lt;cgit@cryptocrack.de&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Fixes a regression introduced in commit 936295c (Simplify commit and tag
parsing, 2015-03-03).

Signed-off-by: Lukas Fleischer &lt;cgit@cryptocrack.de&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Simplify commit and tag parsing</title>
<updated>2015-03-03T15:47:30+00:00</updated>
<author>
<name>Lukas Fleischer</name>
<email>cgit@cryptocrack.de</email>
</author>
<published>2015-03-03T12:00:07+00:00</published>
<link rel='alternate' type='text/html' href='https://git.eugenetriguba.com/forks/cgit/commit/?id=936295c4e4de8da83701c67377a911a0aefbcbd6'/>
<id>936295c4e4de8da83701c67377a911a0aefbcbd6</id>
<content type='text'>
* Use skip_prefix to avoid magic numbers in the code.
* Use xcalloc() instead of xmalloc(), followed by manual initialization.
* Split out line splitting.

Signed-off-by: Lukas Fleischer &lt;cgit@cryptocrack.de&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* Use skip_prefix to avoid magic numbers in the code.
* Use xcalloc() instead of xmalloc(), followed by manual initialization.
* Split out line splitting.

Signed-off-by: Lukas Fleischer &lt;cgit@cryptocrack.de&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Use split_ident_line() in parse_user()</title>
<updated>2014-12-24T08:38:28+00:00</updated>
<author>
<name>Lukas Fleischer</name>
<email>cgit@cryptocrack.de</email>
</author>
<published>2014-12-24T07:50:11+00:00</published>
<link rel='alternate' type='text/html' href='https://git.eugenetriguba.com/forks/cgit/commit/?id=6f9e8a9659996281248c9002497148d489003bce'/>
<id>6f9e8a9659996281248c9002497148d489003bce</id>
<content type='text'>
Use Git's built-in ident line splitting algorithm instead of
reimplementing it. This does not only simplify the code but also makes
sure that cgit is consistent with Git when it comes to author parsing.

Signed-off-by: Lukas Fleischer &lt;cgit@cryptocrack.de&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Use Git's built-in ident line splitting algorithm instead of
reimplementing it. This does not only simplify the code but also makes
sure that cgit is consistent with Git when it comes to author parsing.

Signed-off-by: Lukas Fleischer &lt;cgit@cryptocrack.de&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>git: update to v2.0.3</title>
<updated>2014-07-28T00:01:35+00:00</updated>
<author>
<name>John Keeping</name>
<email>john@keeping.me.uk</email>
</author>
<published>2014-07-27T10:56:19+00:00</published>
<link rel='alternate' type='text/html' href='https://git.eugenetriguba.com/forks/cgit/commit/?id=865afe0eb1b5e6485fe0f65472e6635266e393b1'/>
<id>865afe0eb1b5e6485fe0f65472e6635266e393b1</id>
<content type='text'>
This is slightly more involved than just bumping the version number
because it pulls in a change to convert the commit buffer to a slab,
removing the "buffer" field from "struct commit".  All sites that access
"commit-&gt;buffer" have been changed to use the new functions provided for
this purpose.

Signed-off-by: John Keeping &lt;john@keeping.me.uk&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This is slightly more involved than just bumping the version number
because it pulls in a change to convert the commit buffer to a slab,
removing the "buffer" field from "struct commit".  All sites that access
"commit-&gt;buffer" have been changed to use the new functions provided for
this purpose.

Signed-off-by: John Keeping &lt;john@keeping.me.uk&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>parsing.c: make commit buffer const</title>
<updated>2014-07-28T00:01:23+00:00</updated>
<author>
<name>John Keeping</name>
<email>john@keeping.me.uk</email>
</author>
<published>2014-07-27T10:56:18+00:00</published>
<link rel='alternate' type='text/html' href='https://git.eugenetriguba.com/forks/cgit/commit/?id=93d8ef8f1de4385c565049e1ccd7fdd25e6c14d7'/>
<id>93d8ef8f1de4385c565049e1ccd7fdd25e6c14d7</id>
<content type='text'>
This will be required in order to incorporate the changes to commit
buffer handling in Git 2.0.2.

Signed-off-by: John Keeping &lt;john@keeping.me.uk&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This will be required in order to incorporate the changes to commit
buffer handling in Git 2.0.2.

Signed-off-by: John Keeping &lt;john@keeping.me.uk&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>git: update for git 2.0</title>
<updated>2014-06-28T13:14:56+00:00</updated>
<author>
<name>Christian Hesse</name>
<email>mail@eworm.de</email>
</author>
<published>2014-05-29T15:35:46+00:00</published>
<link rel='alternate' type='text/html' href='https://git.eugenetriguba.com/forks/cgit/commit/?id=79c985e13c10b498c3ea62f4607c2e2a460c3b10'/>
<id>79c985e13c10b498c3ea62f4607c2e2a460c3b10</id>
<content type='text'>
prefixcmp() and suffixcmp() have been remove, functionality is now
provided by starts_with() and ends_with(). Retrurn values have been
changed, so instead of just renaming we have to fix logic.
Everything else looks just fine.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
prefixcmp() and suffixcmp() have been remove, functionality is now
provided by starts_with() and ends_with(). Retrurn values have been
changed, so instead of just renaming we have to fix logic.
Everything else looks just fine.
</pre>
</div>
</content>
</entry>
<entry>
<title>Fix cgit_parse_url when a repo url is contained in another repo url</title>
<updated>2014-04-05T22:05:36+00:00</updated>
<author>
<name>Julian Maurice</name>
<email>julian.maurice@biblibre.com</email>
</author>
<published>2014-03-28T22:18:29+00:00</published>
<link rel='alternate' type='text/html' href='https://git.eugenetriguba.com/forks/cgit/commit/?id=10451797fa2370aab6f4146c86e0fa939a9a982b'/>
<id>10451797fa2370aab6f4146c86e0fa939a9a982b</id>
<content type='text'>
For example, if I have two repos (remove-suffix is enabled):
  /foo
  /foo/bar

http://cgit/foo/bar/ is interpreted as "repository 'foo', command 'bar'"
instead of "repository 'foo/bar'"
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
For example, if I have two repos (remove-suffix is enabled):
  /foo
  /foo/bar

http://cgit/foo/bar/ is interpreted as "repository 'foo', command 'bar'"
instead of "repository 'foo/bar'"
</pre>
</div>
</content>
</entry>
<entry>
<title>parsing.c: Remove leading space from committer</title>
<updated>2014-01-15T23:53:08+00:00</updated>
<author>
<name>Lukas Fleischer</name>
<email>cgit@cryptocrack.de</email>
</author>
<published>2014-01-15T22:09:08+00:00</published>
<link rel='alternate' type='text/html' href='https://git.eugenetriguba.com/forks/cgit/commit/?id=2a7dd4bf67edeff2c6c4f6d6d39d2d7f954d978a'/>
<id>2a7dd4bf67edeff2c6c4f6d6d39d2d7f954d978a</id>
<content type='text'>
This did not really break anything in the past since spaces are ignored
when rendering HTML. Remove the preceding space anyway to prevent from
potential future problems.

Signed-off-by: Lukas Fleischer &lt;cgit@cryptocrack.de&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This did not really break anything in the past since spaces are ignored
when rendering HTML. Remove the preceding space anyway to prevent from
potential future problems.

Signed-off-by: Lukas Fleischer &lt;cgit@cryptocrack.de&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>parsing: fix header typo</title>
<updated>2014-01-10T16:45:43+00:00</updated>
<author>
<name>Jason A. Donenfeld</name>
<email>Jason@zx2c4.com</email>
</author>
<published>2014-01-10T03:59:34+00:00</published>
<link rel='alternate' type='text/html' href='https://git.eugenetriguba.com/forks/cgit/commit/?id=d01a6eec4355af5266b114760c7264a2e6bf73fc'/>
<id>d01a6eec4355af5266b114760c7264a2e6bf73fc</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Replace most uses of strncmp() with prefixcmp()</title>
<updated>2014-01-10T16:01:29+00:00</updated>
<author>
<name>Lukas Fleischer</name>
<email>cgit@cryptocrack.de</email>
</author>
<published>2014-01-10T11:44:35+00:00</published>
<link rel='alternate' type='text/html' href='https://git.eugenetriguba.com/forks/cgit/commit/?id=36bdb2171f7154fcdf1a24d38c8ce3bd7e448cb1'/>
<id>36bdb2171f7154fcdf1a24d38c8ce3bd7e448cb1</id>
<content type='text'>
This is a preparation for replacing all prefix checks with either
strip_prefix() or starts_with() when Git 1.8.6 is released.

Signed-off-by: Lukas Fleischer &lt;cgit@cryptocrack.de&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This is a preparation for replacing all prefix checks with either
strip_prefix() or starts_with() when Git 1.8.6 is released.

Signed-off-by: Lukas Fleischer &lt;cgit@cryptocrack.de&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Update copyright information</title>
<updated>2014-01-08T14:10:49+00:00</updated>
<author>
<name>Lukas Fleischer</name>
<email>cgit@crytocrack.de</email>
</author>
<published>2014-01-08T14:10:49+00:00</published>
<link rel='alternate' type='text/html' href='https://git.eugenetriguba.com/forks/cgit/commit/?id=f7f26f88755ac6a3b9af4918b51b0d6e7a692c78'/>
<id>f7f26f88755ac6a3b9af4918b51b0d6e7a692c78</id>
<content type='text'>
* Name "cgit Development Team" as copyright holder to avoid listing
  every single developer.

* Update copyright ranges.

Signed-off-by: Lukas Fleischer &lt;cgit@crytocrack.de&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* Name "cgit Development Team" as copyright holder to avoid listing
  every single developer.

* Update copyright ranges.

Signed-off-by: Lukas Fleischer &lt;cgit@crytocrack.de&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Mark several functions/variables static</title>
<updated>2013-03-05T00:50:39+00:00</updated>
<author>
<name>Lukas Fleischer</name>
<email>cgit@cryptocrack.de</email>
</author>
<published>2013-03-04T07:52:33+00:00</published>
<link rel='alternate' type='text/html' href='https://git.eugenetriguba.com/forks/cgit/commit/?id=bafab423f20bc1448b293842c235965e1681f07e'/>
<id>bafab423f20bc1448b293842c235965e1681f07e</id>
<content type='text'>
Spotted by parsing the output of `gcc -Wmissing-prototypes [...]`.

Signed-off-by: Lukas Fleischer &lt;cgit@cryptocrack.de&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Spotted by parsing the output of `gcc -Wmissing-prototypes [...]`.

Signed-off-by: Lukas Fleischer &lt;cgit@cryptocrack.de&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>White space around control verbs.</title>
<updated>2013-03-04T14:12:54+00:00</updated>
<author>
<name>Jason A. Donenfeld</name>
<email>Jason@zx2c4.com</email>
</author>
<published>2013-03-04T04:21:33+00:00</published>
<link rel='alternate' type='text/html' href='https://git.eugenetriguba.com/forks/cgit/commit/?id=bdae1d8a8d39206ac75ab86f8e9ef53b2f29432e'/>
<id>bdae1d8a8d39206ac75ab86f8e9ef53b2f29432e</id>
<content type='text'>
Signed-off-by: Jason A. Donenfeld &lt;Jason@zx2c4.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Signed-off-by: Jason A. Donenfeld &lt;Jason@zx2c4.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>do not write outside heap buffer</title>
<updated>2012-10-02T02:03:47+00:00</updated>
<author>
<name>Jim Meyering</name>
<email>meyering@redhat.com</email>
</author>
<published>2012-04-23T20:06:35+00:00</published>
<link rel='alternate' type='text/html' href='https://git.eugenetriguba.com/forks/cgit/commit/?id=61d4147ea2d58c9d129a084be13ccec6ae18b4d5'/>
<id>61d4147ea2d58c9d129a084be13ccec6ae18b4d5</id>
<content type='text'>
* parsing.c (substr): Handle tail &lt; head.

This started when I noticed some cgit segfaults on savannah.gnu.org.
Finding the offending URL/commit and then constructing a stand-alone
reproducer were far more time-consuming than writing the actual patch.

The problem arises with a commit like this, in which the user name
part of the "Author" field is empty:

    $ git log -1
    commit 6f3f41d73393278f3ede68a2cb1e7a2a23fa3421
    Author: &lt;T at h.or&gt;
    Date:   Mon Apr 23 22:29:16 2012 +0200

Here's what happens:

(this is due to buf=malloc(0); strncpy (buf, head, -1);
 where "head" may point to plenty of attacker-specified non-NUL bytes,
 so we can overwrite a zero-length heap buffer with arbitrary data)

 Invalid write of size 1
    at 0x4A09361: strncpy (mc_replace_strmem.c:463)
    by 0x408977: substr (parsing.c:61)
    by 0x4089EF: parse_user (parsing.c:73)
    by 0x408D10: cgit_parse_commit (parsing.c:153)
    by 0x40A540: cgit_mk_refinfo (shared.c:171)
    by 0x40A581: cgit_refs_cb (shared.c:181)
    by 0x43DEB3: do_for_each_ref (refs.c:690)
    by 0x41075E: cgit_print_branches (ui-refs.c:191)
    by 0x416EF2: cgit_print_summary (ui-summary.c:56)
    by 0x40780A: summary_fn (cmd.c:120)
    by 0x40667A: process_request (cgit.c:544)
    by 0x404078: cache_process (cache.c:322)
  Address 0x4c718d0 is 0 bytes after a block of size 0 alloc'd
    at 0x4A0884D: malloc (vg_replace_malloc.c:263)
    by 0x455C85: xmalloc (wrapper.c:35)
    by 0x40894C: substr (parsing.c:60)
    by 0x4089EF: parse_user (parsing.c:73)
    by 0x408D10: cgit_parse_commit (parsing.c:153)
    by 0x40A540: cgit_mk_refinfo (shared.c:171)
    by 0x40A581: cgit_refs_cb (shared.c:181)
    by 0x43DEB3: do_for_each_ref (refs.c:690)
    by 0x41075E: cgit_print_branches (ui-refs.c:191)
    by 0x416EF2: cgit_print_summary (ui-summary.c:56)
    by 0x40780A: summary_fn (cmd.c:120)
    by 0x40667A: process_request (cgit.c:544)

 Invalid write of size 1
    at 0x4A09400: strncpy (mc_replace_strmem.c:463)
    by 0x408977: substr (parsing.c:61)
    by 0x4089EF: parse_user (parsing.c:73)
    by 0x408D10: cgit_parse_commit (parsing.c:153)
    by 0x40A540: cgit_mk_refinfo (shared.c:171)
    by 0x40A581: cgit_refs_cb (shared.c:181)
    by 0x43DEB3: do_for_each_ref (refs.c:690)
    by 0x41075E: cgit_print_branches (ui-refs.c:191)
    by 0x416EF2: cgit_print_summary (ui-summary.c:56)
    by 0x40780A: summary_fn (cmd.c:120)
    by 0x40667A: process_request (cgit.c:544)
    by 0x404078: cache_process (cache.c:322)
  Address 0x4c7192b is not stack'd, malloc'd or (recently) free'd

 Invalid write of size 1
    at 0x4A0940E: strncpy (mc_replace_strmem.c:463)
    by 0x408977: substr (parsing.c:61)
    by 0x4089EF: parse_user (parsing.c:73)
    by 0x408D10: cgit_parse_commit (parsing.c:153)
    by 0x40A540: cgit_mk_refinfo (shared.c:171)
    by 0x40A581: cgit_refs_cb (shared.c:181)
    by 0x43DEB3: do_for_each_ref (refs.c:690)
    by 0x41075E: cgit_print_branches (ui-refs.c:191)
    by 0x416EF2: cgit_print_summary (ui-summary.c:56)
    by 0x40780A: summary_fn (cmd.c:120)
    by 0x40667A: process_request (cgit.c:544)
    by 0x404078: cache_process (cache.c:322)
  Address 0x4c7192d is not stack'd, malloc'd or (recently) free'd

 Process terminating with default action of signal 11 (SIGSEGV)
  Access not within mapped region at address 0x502F000
    at 0x4A09400: strncpy (mc_replace_strmem.c:463)
    by 0x408977: substr (parsing.c:61)
    by 0x4089EF: parse_user (parsing.c:73)
    by 0x408D10: cgit_parse_commit (parsing.c:153)
    by 0x40A540: cgit_mk_refinfo (shared.c:171)
    by 0x40A581: cgit_refs_cb (shared.c:181)
    by 0x43DEB3: do_for_each_ref (refs.c:690)
    by 0x41075E: cgit_print_branches (ui-refs.c:191)
    by 0x416EF2: cgit_print_summary (ui-summary.c:56)
    by 0x40780A: summary_fn (cmd.c:120)
    by 0x40667A: process_request (cgit.c:544)
    by 0x404078: cache_process (cache.c:322)

This happens when tail - head == -1 here:
(parsing.c)

  char *substr(const char *head, const char *tail)
  {
          char *buf;

          buf = xmalloc(tail - head + 1);
          strncpy(buf, head, tail - head);
          buf[tail - head] = '\0';
          return buf;
  }

  char *parse_user(char *t, char **name, char **email, unsigned long *date)
  {
          char *p = t;
          int mode = 1;

          while (p &amp;&amp; *p) {
                  if (mode == 1 &amp;&amp; *p == '&lt;') {
                          *name = substr(t, p - 1);
                          t = p;
                          mode++;
                  } else if (mode == 1 &amp;&amp; *p == '\n') {

The fix is to handle the case of (tail &lt; head) before calling xmalloc,
thus avoiding passing an invalid value to xmalloc.

And here's the reproducer:
It was tricky to reproduce, because git prohibits use of an empty "name"
in a commit ID.  To construct the offending commit, I had to resort to
using "git hash-object".

git init -q foo &amp;&amp;
( cd foo &amp;&amp;
  echo a &gt; j &amp;&amp; git add . &amp;&amp; git ci -q --author='au &lt;T at h.or&gt;' -m. . &amp;&amp;
  h=$(git cat-file commit HEAD|sed 's/au //' \
    |git hash-object -t commit -w --stdin) &amp;&amp;
  git co -q -b test $h &amp;&amp;
  git br -q -D master &amp;&amp;
  git br -q -m test master)
git clone -q --bare foo foo.git

cat &lt;&lt;EOF &gt; in
repo.url=foo.git
repo.path=foo.git
EOF
CGIT_CONFIG=in QUERY_STRING=url=foo.git valgrind ./cgit

The valgrind output is what you see above.

AFAICS, this is not exploitable thanks (ironically) to the use of strncpy.
Since that -1 translates to SIZE_MAX and this is strncpy, not only does it
copy whatever is in "head" (up to first NUL), but it also writes
SIZE_MAX - strlen(head) NUL bytes into the destination buffer, and that
latter is guaranteed to evoke a segfault.  Since cgit is single-threaded,
AFAICS, there is no way that the buffer clobbering can be turned into
an exploit.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* parsing.c (substr): Handle tail &lt; head.

This started when I noticed some cgit segfaults on savannah.gnu.org.
Finding the offending URL/commit and then constructing a stand-alone
reproducer were far more time-consuming than writing the actual patch.

The problem arises with a commit like this, in which the user name
part of the "Author" field is empty:

    $ git log -1
    commit 6f3f41d73393278f3ede68a2cb1e7a2a23fa3421
    Author: &lt;T at h.or&gt;
    Date:   Mon Apr 23 22:29:16 2012 +0200

Here's what happens:

(this is due to buf=malloc(0); strncpy (buf, head, -1);
 where "head" may point to plenty of attacker-specified non-NUL bytes,
 so we can overwrite a zero-length heap buffer with arbitrary data)

 Invalid write of size 1
    at 0x4A09361: strncpy (mc_replace_strmem.c:463)
    by 0x408977: substr (parsing.c:61)
    by 0x4089EF: parse_user (parsing.c:73)
    by 0x408D10: cgit_parse_commit (parsing.c:153)
    by 0x40A540: cgit_mk_refinfo (shared.c:171)
    by 0x40A581: cgit_refs_cb (shared.c:181)
    by 0x43DEB3: do_for_each_ref (refs.c:690)
    by 0x41075E: cgit_print_branches (ui-refs.c:191)
    by 0x416EF2: cgit_print_summary (ui-summary.c:56)
    by 0x40780A: summary_fn (cmd.c:120)
    by 0x40667A: process_request (cgit.c:544)
    by 0x404078: cache_process (cache.c:322)
  Address 0x4c718d0 is 0 bytes after a block of size 0 alloc'd
    at 0x4A0884D: malloc (vg_replace_malloc.c:263)
    by 0x455C85: xmalloc (wrapper.c:35)
    by 0x40894C: substr (parsing.c:60)
    by 0x4089EF: parse_user (parsing.c:73)
    by 0x408D10: cgit_parse_commit (parsing.c:153)
    by 0x40A540: cgit_mk_refinfo (shared.c:171)
    by 0x40A581: cgit_refs_cb (shared.c:181)
    by 0x43DEB3: do_for_each_ref (refs.c:690)
    by 0x41075E: cgit_print_branches (ui-refs.c:191)
    by 0x416EF2: cgit_print_summary (ui-summary.c:56)
    by 0x40780A: summary_fn (cmd.c:120)
    by 0x40667A: process_request (cgit.c:544)

 Invalid write of size 1
    at 0x4A09400: strncpy (mc_replace_strmem.c:463)
    by 0x408977: substr (parsing.c:61)
    by 0x4089EF: parse_user (parsing.c:73)
    by 0x408D10: cgit_parse_commit (parsing.c:153)
    by 0x40A540: cgit_mk_refinfo (shared.c:171)
    by 0x40A581: cgit_refs_cb (shared.c:181)
    by 0x43DEB3: do_for_each_ref (refs.c:690)
    by 0x41075E: cgit_print_branches (ui-refs.c:191)
    by 0x416EF2: cgit_print_summary (ui-summary.c:56)
    by 0x40780A: summary_fn (cmd.c:120)
    by 0x40667A: process_request (cgit.c:544)
    by 0x404078: cache_process (cache.c:322)
  Address 0x4c7192b is not stack'd, malloc'd or (recently) free'd

 Invalid write of size 1
    at 0x4A0940E: strncpy (mc_replace_strmem.c:463)
    by 0x408977: substr (parsing.c:61)
    by 0x4089EF: parse_user (parsing.c:73)
    by 0x408D10: cgit_parse_commit (parsing.c:153)
    by 0x40A540: cgit_mk_refinfo (shared.c:171)
    by 0x40A581: cgit_refs_cb (shared.c:181)
    by 0x43DEB3: do_for_each_ref (refs.c:690)
    by 0x41075E: cgit_print_branches (ui-refs.c:191)
    by 0x416EF2: cgit_print_summary (ui-summary.c:56)
    by 0x40780A: summary_fn (cmd.c:120)
    by 0x40667A: process_request (cgit.c:544)
    by 0x404078: cache_process (cache.c:322)
  Address 0x4c7192d is not stack'd, malloc'd or (recently) free'd

 Process terminating with default action of signal 11 (SIGSEGV)
  Access not within mapped region at address 0x502F000
    at 0x4A09400: strncpy (mc_replace_strmem.c:463)
    by 0x408977: substr (parsing.c:61)
    by 0x4089EF: parse_user (parsing.c:73)
    by 0x408D10: cgit_parse_commit (parsing.c:153)
    by 0x40A540: cgit_mk_refinfo (shared.c:171)
    by 0x40A581: cgit_refs_cb (shared.c:181)
    by 0x43DEB3: do_for_each_ref (refs.c:690)
    by 0x41075E: cgit_print_branches (ui-refs.c:191)
    by 0x416EF2: cgit_print_summary (ui-summary.c:56)
    by 0x40780A: summary_fn (cmd.c:120)
    by 0x40667A: process_request (cgit.c:544)
    by 0x404078: cache_process (cache.c:322)

This happens when tail - head == -1 here:
(parsing.c)

  char *substr(const char *head, const char *tail)
  {
          char *buf;

          buf = xmalloc(tail - head + 1);
          strncpy(buf, head, tail - head);
          buf[tail - head] = '\0';
          return buf;
  }

  char *parse_user(char *t, char **name, char **email, unsigned long *date)
  {
          char *p = t;
          int mode = 1;

          while (p &amp;&amp; *p) {
                  if (mode == 1 &amp;&amp; *p == '&lt;') {
                          *name = substr(t, p - 1);
                          t = p;
                          mode++;
                  } else if (mode == 1 &amp;&amp; *p == '\n') {

The fix is to handle the case of (tail &lt; head) before calling xmalloc,
thus avoiding passing an invalid value to xmalloc.

And here's the reproducer:
It was tricky to reproduce, because git prohibits use of an empty "name"
in a commit ID.  To construct the offending commit, I had to resort to
using "git hash-object".

git init -q foo &amp;&amp;
( cd foo &amp;&amp;
  echo a &gt; j &amp;&amp; git add . &amp;&amp; git ci -q --author='au &lt;T at h.or&gt;' -m. . &amp;&amp;
  h=$(git cat-file commit HEAD|sed 's/au //' \
    |git hash-object -t commit -w --stdin) &amp;&amp;
  git co -q -b test $h &amp;&amp;
  git br -q -D master &amp;&amp;
  git br -q -m test master)
git clone -q --bare foo foo.git

cat &lt;&lt;EOF &gt; in
repo.url=foo.git
repo.path=foo.git
EOF
CGIT_CONFIG=in QUERY_STRING=url=foo.git valgrind ./cgit

The valgrind output is what you see above.

AFAICS, this is not exploitable thanks (ironically) to the use of strncpy.
Since that -1 translates to SIZE_MAX and this is strncpy, not only does it
copy whatever is in "head" (up to first NUL), but it also writes
SIZE_MAX - strlen(head) NUL bytes into the destination buffer, and that
latter is guaranteed to evoke a segfault.  Since cgit is single-threaded,
AFAICS, there is no way that the buffer clobbering can be turned into
an exploit.
</pre>
</div>
</content>
</entry>
<entry>
<title>Remove dead initialization in cgit_parse_commit()</title>
<updated>2011-07-22T12:21:11+00:00</updated>
<author>
<name>Lukas Fleischer</name>
<email>cgit@cryptocrack.de</email>
</author>
<published>2011-07-21T21:04:53+00:00</published>
<link rel='alternate' type='text/html' href='https://git.eugenetriguba.com/forks/cgit/commit/?id=1e25ac5b8fe0ca8760b2786b20d36013a6197e02'/>
<id>1e25ac5b8fe0ca8760b2786b20d36013a6197e02</id>
<content type='text'>
The value stored to "t" during its initialization gets overwritten in
any case, so just leave it uninitialized. Spotted by clang-analyzer.

Signed-off-by: Lukas Fleischer &lt;cgit@cryptocrack.de&gt;
Signed-off-by: Lars Hjemli &lt;hjemli@gmail.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The value stored to "t" during its initialization gets overwritten in
any case, so just leave it uninitialized. Spotted by clang-analyzer.

Signed-off-by: Lukas Fleischer &lt;cgit@cryptocrack.de&gt;
Signed-off-by: Lars Hjemli &lt;hjemli@gmail.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Avoid null pointer dereference in reencode().</title>
<updated>2011-05-23T20:58:35+00:00</updated>
<author>
<name>Lukas Fleischer</name>
<email>cgit@cryptocrack.de</email>
</author>
<published>2011-04-05T08:35:43+00:00</published>
<link rel='alternate' type='text/html' href='https://git.eugenetriguba.com/forks/cgit/commit/?id=a0bf375a1a9b74056a913f3687c6f5b42ad4acf6'/>
<id>a0bf375a1a9b74056a913f3687c6f5b42ad4acf6</id>
<content type='text'>
Returning "*txt" if "txt" is a null pointer is a bad thing. Spotted with
clang-analyzer.

Signed-off-by: Lukas Fleischer &lt;cgit@cryptocrack.de&gt;
Signed-off-by: Lars Hjemli &lt;hjemli@gmail.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Returning "*txt" if "txt" is a null pointer is a bad thing. Spotted with
clang-analyzer.

Signed-off-by: Lukas Fleischer &lt;cgit@cryptocrack.de&gt;
Signed-off-by: Lars Hjemli &lt;hjemli@gmail.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>fix two encoding bugs</title>
<updated>2011-03-26T14:21:07+00:00</updated>
<author>
<name>Julius Plenz</name>
<email>plenz@cis.fu-berlin.de</email>
</author>
<published>2011-03-10T16:03:23+00:00</published>
<link rel='alternate' type='text/html' href='https://git.eugenetriguba.com/forks/cgit/commit/?id=0a799424f682071da9f5b632d1394308e9255bb5'/>
<id>0a799424f682071da9f5b632d1394308e9255bb5</id>
<content type='text'>
reencode() takes three arguments in the order (txt, from, to), opposed to
reencode_string, which will, like iconv, handle the arguments with from
and to swapped. Fix that (this makes reencode more intuitive).
If src and dst encoding are equivalent, don't do any encoding.

If no special encoding parameter is found within the commit, assume
UTF-8 and explicitly convert to PAGE_ENCODING. The change to reencode()
mentioned above avoids re-encoding a UTF-8 string to UTF-8, for example.

Signed-off-by: Julius Plenz &lt;plenz@cis.fu-berlin.de&gt;
Signed-off-by: Lars Hjemli &lt;hjemli@gmail.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
reencode() takes three arguments in the order (txt, from, to), opposed to
reencode_string, which will, like iconv, handle the arguments with from
and to swapped. Fix that (this makes reencode more intuitive).
If src and dst encoding are equivalent, don't do any encoding.

If no special encoding parameter is found within the commit, assume
UTF-8 and explicitly convert to PAGE_ENCODING. The change to reencode()
mentioned above avoids re-encoding a UTF-8 string to UTF-8, for example.

Signed-off-by: Julius Plenz &lt;plenz@cis.fu-berlin.de&gt;
Signed-off-by: Lars Hjemli &lt;hjemli@gmail.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Reencode author and committer</title>
<updated>2010-07-13T17:24:55+00:00</updated>
<author>
<name>Rémi Lagacé</name>
<email>rlagace@cld.ca</email>
</author>
<published>2010-07-13T17:15:09+00:00</published>
<link rel='alternate' type='text/html' href='https://git.eugenetriguba.com/forks/cgit/commit/?id=73ac0fb6f217addbcd7878828407392418c973de'/>
<id>73ac0fb6f217addbcd7878828407392418c973de</id>
<content type='text'>
When a commit has a specific encoding, this encoding also applies to
the author and committer name and email.

Signed-off-by: Lars Hjemli &lt;hjemli@gmail.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
When a commit has a specific encoding, this encoding also applies to
the author and committer name and email.

Signed-off-by: Lars Hjemli &lt;hjemli@gmail.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>parsing.c: enable builds with NO_ICONV defined</title>
<updated>2008-12-05T18:10:28+00:00</updated>
<author>
<name>Lars Hjemli</name>
<email>hjemli@gmail.com</email>
</author>
<published>2008-12-05T18:10:28+00:00</published>
<link rel='alternate' type='text/html' href='https://git.eugenetriguba.com/forks/cgit/commit/?id=14b4e108a73b09ce9b6df2c7f2e417305ad68cf4'/>
<id>14b4e108a73b09ce9b6df2c7f2e417305ad68cf4</id>
<content type='text'>
Signed-off-by: Lars Hjemli &lt;hjemli@gmail.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Signed-off-by: Lars Hjemli &lt;hjemli@gmail.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>parsing.c: be prepared for unexpected content in commit/tag objects</title>
<updated>2008-09-15T20:33:11+00:00</updated>
<author>
<name>Lars Hjemli</name>
<email>hjemli@gmail.com</email>
</author>
<published>2008-09-14T07:45:37+00:00</published>
<link rel='alternate' type='text/html' href='https://git.eugenetriguba.com/forks/cgit/commit/?id=a8305a9543969206aa7cec03948c5a19950eedb9'/>
<id>a8305a9543969206aa7cec03948c5a19950eedb9</id>
<content type='text'>
When parsing commits and tags cgit made too many assumptions about the
formatting of said objects. This patch tries to make the code be more
prepared to handle 'malformed' objects.

Signed-off-by: Lars Hjemli &lt;hjemli@gmail.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
When parsing commits and tags cgit made too many assumptions about the
formatting of said objects. This patch tries to make the code be more
prepared to handle 'malformed' objects.

Signed-off-by: Lars Hjemli &lt;hjemli@gmail.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Move cgit_parse_query() from parsing.c to html.c as http_parse_querystring()</title>
<updated>2008-04-08T19:11:36+00:00</updated>
<author>
<name>Lars Hjemli</name>
<email>hjemli@gmail.com</email>
</author>
<published>2008-04-08T19:11:36+00:00</published>
<link rel='alternate' type='text/html' href='https://git.eugenetriguba.com/forks/cgit/commit/?id=e87e89633383b8b75c68c98be3e0c14212109de2'/>
<id>e87e89633383b8b75c68c98be3e0c14212109de2</id>
<content type='text'>
This is a generic http-function.

Signed-off-by: Lars Hjemli &lt;hjemli@gmail.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This is a generic http-function.

Signed-off-by: Lars Hjemli &lt;hjemli@gmail.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Move function for configfile parsing into configfile.[ch]</title>
<updated>2008-03-27T23:09:11+00:00</updated>
<author>
<name>Lars Hjemli</name>
<email>hjemli@gmail.com</email>
</author>
<published>2008-03-27T23:09:11+00:00</published>
<link rel='alternate' type='text/html' href='https://git.eugenetriguba.com/forks/cgit/commit/?id=20a33548b9a87a6eb23162ee5d137daa46d78613'/>
<id>20a33548b9a87a6eb23162ee5d137daa46d78613</id>
<content type='text'>
This is a generic function which wanted its own little object file.

Signed-off-by: Lars Hjemli &lt;hjemli@gmail.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This is a generic function which wanted its own little object file.

Signed-off-by: Lars Hjemli &lt;hjemli@gmail.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Add command dispatcher</title>
<updated>2008-03-24T00:43:48+00:00</updated>
<author>
<name>Lars Hjemli</name>
<email>hjemli@gmail.com</email>
</author>
<published>2008-03-24T00:09:39+00:00</published>
<link rel='alternate' type='text/html' href='https://git.eugenetriguba.com/forks/cgit/commit/?id=e0e4478e7b4812f822d60a13a33525f8e529e1e8'/>
<id>e0e4478e7b4812f822d60a13a33525f8e529e1e8</id>
<content type='text'>
This simplifies the code in cgit.c and makes it easier to extend cgit with
new pages/commands.

Signed-off-by: Lars Hjemli &lt;hjemli@gmail.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This simplifies the code in cgit.c and makes it easier to extend cgit with
new pages/commands.

Signed-off-by: Lars Hjemli &lt;hjemli@gmail.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Move cgit_repo into cgit_context</title>
<updated>2008-02-16T12:56:09+00:00</updated>
<author>
<name>Lars Hjemli</name>
<email>hjemli@gmail.com</email>
</author>
<published>2008-02-16T12:56:09+00:00</published>
<link rel='alternate' type='text/html' href='https://git.eugenetriguba.com/forks/cgit/commit/?id=d1f3bbe9d22029f45a77bb938c176ccc0c827d46'/>
<id>d1f3bbe9d22029f45a77bb938c176ccc0c827d46</id>
<content type='text'>
This removes the global variable which is used to keep track of the
currently selected repository, and adds a new variable in the cgit_context
structure.

Signed-off-by: Lars Hjemli &lt;hjemli@gmail.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This removes the global variable which is used to keep track of the
currently selected repository, and adds a new variable in the cgit_context
structure.

Signed-off-by: Lars Hjemli &lt;hjemli@gmail.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Introduce struct cgit_context</title>
<updated>2008-02-16T11:07:28+00:00</updated>
<author>
<name>Lars Hjemli</name>
<email>hjemli@gmail.com</email>
</author>
<published>2008-02-16T10:53:40+00:00</published>
<link rel='alternate' type='text/html' href='https://git.eugenetriguba.com/forks/cgit/commit/?id=d14d77fe95c3b6224b40df9b101dded0deea913c'/>
<id>d14d77fe95c3b6224b40df9b101dded0deea913c</id>
<content type='text'>
This struct will hold all the cgit runtime information currently found in
a multitude of global variables.

The first cleanup removes all querystring-related variables.

Signed-off-by: Lars Hjemli &lt;hjemli@gmail.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This struct will hold all the cgit runtime information currently found in
a multitude of global variables.

The first cleanup removes all querystring-related variables.

Signed-off-by: Lars Hjemli &lt;hjemli@gmail.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Merge branch 'stable'</title>
<updated>2007-12-02T21:28:37+00:00</updated>
<author>
<name>Lars Hjemli</name>
<email>hjemli@gmail.com</email>
</author>
<published>2007-12-02T21:28:37+00:00</published>
<link rel='alternate' type='text/html' href='https://git.eugenetriguba.com/forks/cgit/commit/?id=dabb34af760eff2a6ab8e14927fd173cafb77547'/>
<id>dabb34af760eff2a6ab8e14927fd173cafb77547</id>
<content type='text'>
* stable:
  Handle missing timestamp in commit/tag objects
  Set commit date on snapshot contents
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* stable:
  Handle missing timestamp in commit/tag objects
  Set commit date on snapshot contents
</pre>
</div>
</content>
</entry>
<entry>
<title>Handle missing timestamp in commit/tag objects</title>
<updated>2007-12-02T21:27:07+00:00</updated>
<author>
<name>Lars Hjemli</name>
<email>hjemli@gmail.com</email>
</author>
<published>2007-12-02T21:11:35+00:00</published>
<link rel='alternate' type='text/html' href='https://git.eugenetriguba.com/forks/cgit/commit/?id=fc4c4ba3a99f4fe4bd8a42caca902269d2e0b678'/>
<id>fc4c4ba3a99f4fe4bd8a42caca902269d2e0b678</id>
<content type='text'>
When a commit or tag lacks author/committer/tagger timestamp, do not skip
the next line in the commit/tag object.

Also, do not bother to print timestamps with value 0 as it is close to certain
to be bogus.

Signed-off-by: Lars Hjemli &lt;hjemli@gmail.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
When a commit or tag lacks author/committer/tagger timestamp, do not skip
the next line in the commit/tag object.

Also, do not bother to print timestamps with value 0 as it is close to certain
to be bogus.

Signed-off-by: Lars Hjemli &lt;hjemli@gmail.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Use utf8::reencode_string from git</title>
<updated>2007-11-05T23:13:31+00:00</updated>
<author>
<name>Lars Hjemli</name>
<email>hjemli@gmail.com</email>
</author>
<published>2007-11-05T21:27:43+00:00</published>
<link rel='alternate' type='text/html' href='https://git.eugenetriguba.com/forks/cgit/commit/?id=a2ebbd6948da96172108db5e9c02c141923ad05c'/>
<id>a2ebbd6948da96172108db5e9c02c141923ad05c</id>
<content type='text'>
This replaces the iconv-support in cgit with similar functions already
existing in git.

Signed-off-by: Lars Hjemli &lt;hjemli@gmai.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This replaces the iconv-support in cgit with similar functions already
existing in git.

Signed-off-by: Lars Hjemli &lt;hjemli@gmai.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Convert subject and message with iconv_msg.</title>
<updated>2007-11-05T23:13:31+00:00</updated>
<author>
<name>Jonathan Bastien-Filiatrault</name>
<email>joe@x2a.org</email>
</author>
<published>2007-10-26T22:13:41+00:00</published>
<link rel='alternate' type='text/html' href='https://git.eugenetriguba.com/forks/cgit/commit/?id=7858a309d7671109950ec940f893c2d112d36b99'/>
<id>7858a309d7671109950ec940f893c2d112d36b99</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Add iconv_msg function.</title>
<updated>2007-11-05T23:13:30+00:00</updated>
<author>
<name>Jonathan Bastien-Filiatrault</name>
<email>joe@x2a.org</email>
</author>
<published>2007-10-26T22:11:26+00:00</published>
<link rel='alternate' type='text/html' href='https://git.eugenetriguba.com/forks/cgit/commit/?id=af0819830445e39584a0137034562086a55deaf2'/>
<id>af0819830445e39584a0137034562086a55deaf2</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Set msg_encoding according to the header.</title>
<updated>2007-11-05T23:13:30+00:00</updated>
<author>
<name>Jonathan Bastien-Filiatrault</name>
<email>joe@x2a.org</email>
</author>
<published>2007-10-26T22:10:26+00:00</published>
<link rel='alternate' type='text/html' href='https://git.eugenetriguba.com/forks/cgit/commit/?id=aa5cc328f4894ba6972842b4edbca3017f169050'/>
<id>aa5cc328f4894ba6972842b4edbca3017f169050</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Add commit-&gt;msg_encoding, allocate msg dynamicly.</title>
<updated>2007-11-05T23:13:30+00:00</updated>
<author>
<name>Jonathan Bastien-Filiatrault</name>
<email>joe@x2a.org</email>
</author>
<published>2007-10-26T22:09:06+00:00</published>
<link rel='alternate' type='text/html' href='https://git.eugenetriguba.com/forks/cgit/commit/?id=3845e177e4e0b231efb6fda0ac3cd3a2d8f34d4b'/>
<id>3845e177e4e0b231efb6fda0ac3cd3a2d8f34d4b</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>cgit_parse_commit(): Add missing call to xstrdup()</title>
<updated>2007-10-27T11:55:12+00:00</updated>
<author>
<name>Lars Hjemli</name>
<email>hjemli@gmail.com</email>
</author>
<published>2007-10-27T11:50:18+00:00</published>
<link rel='alternate' type='text/html' href='https://git.eugenetriguba.com/forks/cgit/commit/?id=c61360fea0357672d2ab84a2c5a41ae1569f5d8a'/>
<id>c61360fea0357672d2ab84a2c5a41ae1569f5d8a</id>
<content type='text'>
It's rather silly to point into random memory-locations. Also, remove a
call to strdup() used on a literal char *.

Signed-off-by: Lars Hjemli &lt;hjemli@gmail.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
It's rather silly to point into random memory-locations. Also, remove a
call to strdup() used on a literal char *.

Signed-off-by: Lars Hjemli &lt;hjemli@gmail.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Skip unknown header fields when parsing tags and commits</title>
<updated>2007-10-27T07:05:40+00:00</updated>
<author>
<name>Lars Hjemli</name>
<email>hjemli@gmail.com</email>
</author>
<published>2007-10-24T19:14:44+00:00</published>
<link rel='alternate' type='text/html' href='https://git.eugenetriguba.com/forks/cgit/commit/?id=13d2b0b25cf19de03c7cdcf8bb708be1168aeda7'/>
<id>13d2b0b25cf19de03c7cdcf8bb708be1168aeda7</id>
<content type='text'>
Both the commit- and tagparser failed to handle unexpected header fields.
This adds futureproofing by simply skipping any header we don't know/care
about.

Signed-off-by: Lars Hjemli &lt;hjemli@gmail.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Both the commit- and tagparser failed to handle unexpected header fields.
This adds futureproofing by simply skipping any header we don't know/care
about.

Signed-off-by: Lars Hjemli &lt;hjemli@gmail.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Add trim_end() and use it to remove trailing slashes from repo paths</title>
<updated>2007-06-26T16:04:39+00:00</updated>
<author>
<name>Lars Hjemli</name>
<email>hjemli@gmail.com</email>
</author>
<published>2007-06-26T16:04:31+00:00</published>
<link rel='alternate' type='text/html' href='https://git.eugenetriguba.com/forks/cgit/commit/?id=382805ee83b6e6f165159312a9fe20e3971897b6'/>
<id>382805ee83b6e6f165159312a9fe20e3971897b6</id>
<content type='text'>
The new function removes all trailing instances of an arbitrary character
from a copy of the supplied char array. This is then used to remove any
trailing slashes from cgit_query_path.

Signed-off-by: Lars Hjemli &lt;hjemli@gmail.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The new function removes all trailing instances of an arbitrary character
from a copy of the supplied char array. This is then used to remove any
trailing slashes from cgit_query_path.

Signed-off-by: Lars Hjemli &lt;hjemli@gmail.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Check for NULL commit buffer in cgit_parse_commit()</title>
<updated>2007-05-31T08:24:43+00:00</updated>
<author>
<name>Ondrej Jirman</name>
<email>ondrej.jirman@zonio.net</email>
</author>
<published>2007-05-26T01:27:49+00:00</published>
<link rel='alternate' type='text/html' href='https://git.eugenetriguba.com/forks/cgit/commit/?id=6130231ed5e7475836a44d79d5f09e300e71a407'/>
<id>6130231ed5e7475836a44d79d5f09e300e71a407</id>
<content type='text'>
This can be NULL, so try not to segfault.

Signed-off-by: Lars Hjemli &lt;hjemli@gmail.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This can be NULL, so try not to segfault.

Signed-off-by: Lars Hjemli &lt;hjemli@gmail.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Handle single-line and empty commit subjects</title>
<updated>2007-05-31T08:21:50+00:00</updated>
<author>
<name>Ondrej Jirman</name>
<email>ondrej.jirman@zonio.net</email>
</author>
<published>2007-05-26T00:19:38+00:00</published>
<link rel='alternate' type='text/html' href='https://git.eugenetriguba.com/forks/cgit/commit/?id=3ce6fc16ef4670c535c6e35d48c7f980ff8a5532'/>
<id>3ce6fc16ef4670c535c6e35d48c7f980ff8a5532</id>
<content type='text'>
If commit object ends with \0 after subject line, then info-&gt;subject
was not set.

This commit fixes this and also sets subject to ** empty ** if it
would otherwise be empty, so that there is something to click on.

Signed-off-by: Lars Hjemli &lt;hjemli@gmail.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
If commit object ends with \0 after subject line, then info-&gt;subject
was not set.

This commit fixes this and also sets subject to ** empty ** if it
would otherwise be empty, so that there is something to click on.

Signed-off-by: Lars Hjemli &lt;hjemli@gmail.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Don't be fooled by trailing '/' in url-parameter</title>
<updated>2007-05-18T20:51:02+00:00</updated>
<author>
<name>Lars Hjemli</name>
<email>hjemli@gmail.com</email>
</author>
<published>2007-05-18T11:06:45+00:00</published>
<link rel='alternate' type='text/html' href='https://git.eugenetriguba.com/forks/cgit/commit/?id=3de63b264c36888dfd42dfdf3fc0aad4ce0c2b5c'/>
<id>3de63b264c36888dfd42dfdf3fc0aad4ce0c2b5c</id>
<content type='text'>
cgit_parse_url() didn't check if the path-part of urls contained a
real path or just a trailing slash. This made the log-page die since
the path filtering supplied an invalid path argument. This fixes it.

Signed-off-by: Lars Hjemli &lt;hjemli@gmail.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
cgit_parse_url() didn't check if the path-part of urls contained a
real path or just a trailing slash. This made the log-page die since
the path filtering supplied an invalid path argument. This fixes it.

Signed-off-by: Lars Hjemli &lt;hjemli@gmail.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Enable url=value querystring parameter</title>
<updated>2007-05-18T20:51:01+00:00</updated>
<author>
<name>Lars Hjemli</name>
<email>hjemli@gmail.com</email>
</author>
<published>2007-05-18T01:00:54+00:00</published>
<link rel='alternate' type='text/html' href='https://git.eugenetriguba.com/forks/cgit/commit/?id=30ccdcaa74ebc0aab2b7843b0db8251d0ddf56de'/>
<id>30ccdcaa74ebc0aab2b7843b0db8251d0ddf56de</id>
<content type='text'>
This makes is possible to use repo-urls like '/pub/scm/git/git.git' and
even add path specifications, like '/pub/scm/git/git.git/log/documentation'.

Signed-off-by: Lars Hjemli &lt;hjemli@gmail.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This makes is possible to use repo-urls like '/pub/scm/git/git.git' and
even add path specifications, like '/pub/scm/git/git.git/log/documentation'.

Signed-off-by: Lars Hjemli &lt;hjemli@gmail.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Restrict deep nesting of configfiles</title>
<updated>2007-05-15T21:32:25+00:00</updated>
<author>
<name>Lars Hjemli</name>
<email>hjemli@gmail.com</email>
</author>
<published>2007-05-15T21:28:40+00:00</published>
<link rel='alternate' type='text/html' href='https://git.eugenetriguba.com/forks/cgit/commit/?id=47a81c77fdd017227632c4df9a0b7b135b8a738d'/>
<id>47a81c77fdd017227632c4df9a0b7b135b8a738d</id>
<content type='text'>
There is no point in restricting the number of included config-
files, but there is a point in restricting the nestinglevel
of configfiles: to avoid recursive inclusions. This is easily
achieved by decrementing the static nesting-variable upon exit
from cgit_read_config().

Also fix some whitespace breakage.

Signed-off-by: Lars Hjemli &lt;hjemli@gmail.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
There is no point in restricting the number of included config-
files, but there is a point in restricting the nestinglevel
of configfiles: to avoid recursive inclusions. This is easily
achieved by decrementing the static nesting-variable upon exit
from cgit_read_config().

Also fix some whitespace breakage.

Signed-off-by: Lars Hjemli &lt;hjemli@gmail.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Add include-parameter to config files</title>
<updated>2007-05-14T21:40:33+00:00</updated>
<author>
<name>Lars Hjemli</name>
<email>hjemli@gmail.com</email>
</author>
<published>2007-05-14T21:40:33+00:00</published>
<link rel='alternate' type='text/html' href='https://git.eugenetriguba.com/forks/cgit/commit/?id=5ec6e02bd1cc0c05b7cfd0d53371e7d176daec39'/>
<id>5ec6e02bd1cc0c05b7cfd0d53371e7d176daec39</id>
<content type='text'>
This parameter can be used to include another config-file, like
a standalone repository listing.

Suggested in a patch by Kristian Høgsberg &lt;krh@bitplanet.net&gt;

Signed-off-by: Lars Hjemli &lt;hjemli@gmail.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This parameter can be used to include another config-file, like
a standalone repository listing.

Suggested in a patch by Kristian Høgsberg &lt;krh@bitplanet.net&gt;

Signed-off-by: Lars Hjemli &lt;hjemli@gmail.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Update to libgit 1.5.2-rc2</title>
<updated>2007-05-08T21:38:49+00:00</updated>
<author>
<name>Lars Hjemli</name>
<email>hjemli@gmail.com</email>
</author>
<published>2007-05-08T20:40:59+00:00</published>
<link rel='alternate' type='text/html' href='https://git.eugenetriguba.com/forks/cgit/commit/?id=61c3ca978c586c673aec618cb94210657278dda8'/>
<id>61c3ca978c586c673aec618cb94210657278dda8</id>
<content type='text'>
Signed-off-by: Lars Hjemli &lt;hjemli@gmail.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Signed-off-by: Lars Hjemli &lt;hjemli@gmail.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Do not die if tag has no message</title>
<updated>2007-02-04T20:21:46+00:00</updated>
<author>
<name>Lars Hjemli</name>
<email>hjemli@gmail.com</email>
</author>
<published>2007-02-03T15:11:41+00:00</published>
<link rel='alternate' type='text/html' href='https://git.eugenetriguba.com/forks/cgit/commit/?id=ebd7b0fbc378e9beca0b275c5cd9150c930bde56'/>
<id>ebd7b0fbc378e9beca0b275c5cd9150c930bde56</id>
<content type='text'>
Signed-off-by: Lars Hjemli &lt;hjemli@gmail.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Signed-off-by: Lars Hjemli &lt;hjemli@gmail.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Add function cgit_parse_tag()</title>
<updated>2007-01-17T00:09:51+00:00</updated>
<author>
<name>Lars Hjemli</name>
<email>hjemli@gmail.com</email>
</author>
<published>2007-01-17T00:09:51+00:00</published>
<link rel='alternate' type='text/html' href='https://git.eugenetriguba.com/forks/cgit/commit/?id=a69061fdb7380d73715aeb3a0da6e91a24df90e4'/>
<id>a69061fdb7380d73715aeb3a0da6e91a24df90e4</id>
<content type='text'>
Teach cgit how to extract author info from a tag.

Signed-off-by: Lars Hjemli &lt;hjemli@gmail.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Teach cgit how to extract author info from a tag.

Signed-off-by: Lars Hjemli &lt;hjemli@gmail.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Handle empty/malformed commit messages</title>
<updated>2007-01-16T17:41:01+00:00</updated>
<author>
<name>Lars Hjemli</name>
<email>hjemli@gmail.com</email>
</author>
<published>2007-01-16T17:41:01+00:00</published>
<link rel='alternate' type='text/html' href='https://git.eugenetriguba.com/forks/cgit/commit/?id=66091f934a2d064ae55095cdc5ae008b43ea60fe'/>
<id>66091f934a2d064ae55095cdc5ae008b43ea60fe</id>
<content type='text'>
An empty commit message would trigger a segfault in the current
cgit_parse_commit().

Also, make sure that all char-pointers are properly initialized.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
An empty commit message would trigger a segfault in the current
cgit_parse_commit().

Also, make sure that all char-pointers are properly initialized.
</pre>
</div>
</content>
</entry>
<entry>
<title>Handle %xx encoding in querystring</title>
<updated>2007-01-04T15:57:00+00:00</updated>
<author>
<name>Lars Hjemli</name>
<email>larsh@hal-2004.(none)</email>
</author>
<published>2007-01-04T15:53:03+00:00</published>
<link rel='alternate' type='text/html' href='https://git.eugenetriguba.com/forks/cgit/commit/?id=52e605caf573fa20fdd4fbac5e1cc69b7740b1f5'/>
<id>52e605caf573fa20fdd4fbac5e1cc69b7740b1f5</id>
<content type='text'>
Convert valid %xx expressions in querystring to ascii, ignore invalid
expressions (i.e. eat the three characters %xx).

Signed-off-by: Lars Hjemli &lt;larsh@hal-2004.(none)&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Convert valid %xx expressions in querystring to ascii, ignore invalid
expressions (i.e. eat the three characters %xx).

Signed-off-by: Lars Hjemli &lt;larsh@hal-2004.(none)&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Handle '+' in querystring</title>
<updated>2006-12-28T01:51:46+00:00</updated>
<author>
<name>Lars Hjemli</name>
<email>hjemli@gmail.com</email>
</author>
<published>2006-12-28T01:51:46+00:00</published>
<link rel='alternate' type='text/html' href='https://git.eugenetriguba.com/forks/cgit/commit/?id=05b13194b4b40a2614692125d5037ef20c5fb20e'/>
<id>05b13194b4b40a2614692125d5037ef20c5fb20e</id>
<content type='text'>
Translate '+' to ' ' in querystring parser (still doesn't handle %xx)

Signed-off-by: Lars Hjemli &lt;hjemli@gmail.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Translate '+' to ' ' in querystring parser (still doesn't handle %xx)

Signed-off-by: Lars Hjemli &lt;hjemli@gmail.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Teach commit parser about author/committer email + timestamp</title>
<updated>2006-12-16T13:25:41+00:00</updated>
<author>
<name>Lars Hjemli</name>
<email>hjemli@gmail.com</email>
</author>
<published>2006-12-16T13:25:41+00:00</published>
<link rel='alternate' type='text/html' href='https://git.eugenetriguba.com/forks/cgit/commit/?id=77078ba716ccdfdc954741355dd6a17632db961b'/>
<id>77078ba716ccdfdc954741355dd6a17632db961b</id>
<content type='text'>
We want all four of these when showing a commit, so save them in the
commitinfo struct.

Btw: There's probably no good reason to save committer timestamp since
it's already available in commit-&gt;date. But it doesn't hurt us either,
and it makes the parser look more complete, so we just do it.

Signed-off-by: Lars Hjemli &lt;hjemli@gmail.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
We want all four of these when showing a commit, so save them in the
commitinfo struct.

Btw: There's probably no good reason to save committer timestamp since
it's already available in commit-&gt;date. But it doesn't hurt us either,
and it makes the parser look more complete, so we just do it.

Signed-off-by: Lars Hjemli &lt;hjemli@gmail.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Add ui-commit.c + misc ui cleanups</title>
<updated>2006-12-15T23:19:56+00:00</updated>
<author>
<name>Lars Hjemli</name>
<email>hjemli@gmail.com</email>
</author>
<published>2006-12-15T23:19:56+00:00</published>
<link rel='alternate' type='text/html' href='https://git.eugenetriguba.com/forks/cgit/commit/?id=9a8f88658d51aeb86a79ac1121de13562ad2601f'/>
<id>9a8f88658d51aeb86a79ac1121de13562ad2601f</id>
<content type='text'>
Signed-off-by: Lars Hjemli &lt;hjemli@gmail.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Signed-off-by: Lars Hjemli &lt;hjemli@gmail.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Add a common commit parser</title>
<updated>2006-12-15T17:17:36+00:00</updated>
<author>
<name>Lars Hjemli</name>
<email>hjemli@gmail.com</email>
</author>
<published>2006-12-15T17:17:36+00:00</published>
<link rel='alternate' type='text/html' href='https://git.eugenetriguba.com/forks/cgit/commit/?id=2101e26fd68f816e77de62b93df4c32fd1110d0c'/>
<id>2101e26fd68f816e77de62b93df4c32fd1110d0c</id>
<content type='text'>
Make a better commit parser, replacing the ugly one in ui-log.c

Signed-off-by: Lars Hjemli &lt;hjemli@gmail.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Make a better commit parser, replacing the ugly one in ui-log.c

Signed-off-by: Lars Hjemli &lt;hjemli@gmail.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Rename config.c to parsing.c + move cgit_parse_query from cgit.c to parsing.c</title>
<updated>2006-12-11T15:11:40+00:00</updated>
<author>
<name>Lars Hjemli</name>
<email>hjemli@gmail.com</email>
</author>
<published>2006-12-11T15:11:40+00:00</published>
<link rel='alternate' type='text/html' href='https://git.eugenetriguba.com/forks/cgit/commit/?id=51ada4fda2b47710351e6e4da8a95807d6d9f729'/>
<id>51ada4fda2b47710351e6e4da8a95807d6d9f729</id>
<content type='text'>
Signed-off-by: Lars Hjemli &lt;hjemli@gmail.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Signed-off-by: Lars Hjemli &lt;hjemli@gmail.com&gt;
</pre>
</div>
</content>
</entry>
</feed>
