<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/url.c, branch v2.22.2</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=v2.22.2</id>
<link rel='self' href='https://git.shady.money/git/atom?h=v2.22.2'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2019-06-04T21:48:25Z</updated>
<entry>
<title>url: do not allow %00 to represent NUL in URLs</title>
<updated>2019-06-04T21:48:25Z</updated>
<author>
<name>Matthew DeVore</name>
<email>matvore@google.com</email>
</author>
<published>2019-06-04T17:57:05Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=d37dc239a427a367427f9c4fdf12a148ad811968'/>
<id>urn:sha1:d37dc239a427a367427f9c4fdf12a148ad811968</id>
<content type='text'>
There is no reason to allow %00 to terminate a string, so do not allow it.
Otherwise, we end up returning arbitrary content in the string (that which is
after the %00) which is effectively hidden from callers and can escape sanity
checks and validation, and possible be used in tandem with a security
vulnerability to introduce a payload.

Helped-by: brian m. carlson &lt;sandals@crustytoothpaste.net&gt;
Signed-off-by: Matthew DeVore &lt;matvore@google.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>url: do not read past end of buffer</title>
<updated>2019-06-04T21:48:06Z</updated>
<author>
<name>Matthew DeVore</name>
<email>matvore@google.com</email>
</author>
<published>2019-06-04T17:57:04Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=3f6b8a6177f3197ddad82a6da2ff9b4704664f5d'/>
<id>urn:sha1:3f6b8a6177f3197ddad82a6da2ff9b4704664f5d</id>
<content type='text'>
url_decode_internal could have been tricked into reading past the length
of the **query buffer if there are fewer than 2 characters after a % (in
a null-terminated string, % would have to be the last character).
Prevent this from happening by checking len before decoding the %
sequence.

Helped-by: René Scharfe &lt;l.s.r@web.de&gt;
Signed-off-by: Matthew DeVore &lt;matvore@google.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>style: the opening '{' of a function is in a separate line</title>
<updated>2018-12-10T06:41:09Z</updated>
<author>
<name>Nguyễn Thái Ngọc Duy</name>
<email>pclouds@gmail.com</email>
</author>
<published>2018-12-09T10:25:21Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=3b3357626edc841a51d8885ddf6986bab5b6f778'/>
<id>urn:sha1:3b3357626edc841a51d8885ddf6986bab5b6f778</id>
<content type='text'>
Signed-off-by: Nguyễn Thái Ngọc Duy &lt;pclouds@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>introduce hex2chr() for converting two hexadecimal digits to a character</title>
<updated>2016-09-07T17:42:46Z</updated>
<author>
<name>René Scharfe</name>
<email>l.s.r@web.de</email>
</author>
<published>2016-09-03T15:59:20Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=d23309733a5b2a9e1adc304ee50c5a5ed7a087c2'/>
<id>urn:sha1:d23309733a5b2a9e1adc304ee50c5a5ed7a087c2</id>
<content type='text'>
Add and use a helper function that decodes the char value of two
hexadecimal digits.  It returns a negative number on error, avoids
running over the end of the given string and doesn't shift negative
values.

Signed-off-by: Rene Scharfe &lt;l.s.r@web.de&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>use strbuf_complete to conditionally append slash</title>
<updated>2015-10-05T18:08:06Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2015-09-24T21:08:35Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=00b6c178c3ab475098f7a0bc63b2df2da508020c'/>
<id>urn:sha1:00b6c178c3ab475098f7a0bc63b2df2da508020c</id>
<content type='text'>
When working with paths in strbufs, we frequently want to
ensure that a directory contains a trailing slash before
appending to it. We can shorten this code (and make the
intent more obvious) by calling strbuf_complete.

Most of these cases are trivially identical conversions, but
there are two things to note:

  - in a few cases we did not check that the strbuf is
    non-empty (which would lead to an out-of-bounds memory
    access). These were generally not triggerable in
    practice, either from earlier assertions, or typically
    because we would have just fed the strbuf to opendir(),
    which would choke on an empty path.

  - in a few cases we indexed the buffer with "original_len"
    or similar, rather than the current sb-&gt;len, and it is
    not immediately obvious from the diff that they are the
    same. In all of these cases, I manually verified that
    the strbuf does not change between the assignment and
    the strbuf_complete call.

This does not convert cases which look like:

  if (sb-&gt;len &amp;&amp; !is_dir_sep(sb-&gt;buf[sb-&gt;len - 1]))
	  strbuf_addch(sb, '/');

as those are obviously semantically different. Some of these
cases arguably should be doing that, but that is out of
scope for this change, which aims purely for cleanup with no
behavior change (and at least it will make such sites easier
to find and examine in the future, as we can grep for
strbuf_complete).

Signed-off-by: Jeff King &lt;peff@peff.net&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>use strbuf_addch for adding single characters</title>
<updated>2014-07-10T21:06:46Z</updated>
<author>
<name>René Scharfe</name>
<email>l.s.r@web.de</email>
</author>
<published>2014-07-10T08:54:24Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=294b2680cd89234618e329e090b68dc69cc41a37'/>
<id>urn:sha1:294b2680cd89234618e329e090b68dc69cc41a37</id>
<content type='text'>
Signed-off-by: Rene Scharfe &lt;l.s.r@web.de&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'jk/http-auth'</title>
<updated>2011-10-18T04:37:15Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2011-10-18T04:37:15Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=963838402a94e7fcbd1a73019f80aff708972af8'/>
<id>urn:sha1:963838402a94e7fcbd1a73019f80aff708972af8</id>
<content type='text'>
* jk/http-auth:
  http_init: accept separate URL parameter
  http: use hostname in credential description
  http: retry authentication failures for all http requests
  remote-curl: don't retry auth failures with dumb protocol
  improve httpd auth tests
  url: decode buffers that are not NUL-terminated
</content>
</entry>
<entry>
<title>Merge branch 'jc/is-url-simplify'</title>
<updated>2011-10-14T02:03:21Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2011-10-14T02:03:21Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=8b482c0ccca22857709e7f483f0079d7be7327f6'/>
<id>urn:sha1:8b482c0ccca22857709e7f483f0079d7be7327f6</id>
<content type='text'>
* jc/is-url-simplify:
  url.c: simplify is_url()
</content>
</entry>
<entry>
<title>url.c: simplify is_url()</title>
<updated>2011-10-03T17:56:42Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2011-10-03T17:56:42Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=b33a1b9fe794df53b449ffdbba0b39ef9e1772bf'/>
<id>urn:sha1:b33a1b9fe794df53b449ffdbba0b39ef9e1772bf</id>
<content type='text'>
The function was implemented in an overly complicated way.
Rewrite it to check from left to right in a single pass.

Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>url: decode buffers that are not NUL-terminated</title>
<updated>2011-07-20T18:38:34Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2011-07-18T07:48:51Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=66c8448543432308e8fce5e3e04076e875410f67'/>
<id>urn:sha1:66c8448543432308e8fce5e3e04076e875410f67</id>
<content type='text'>
The url_decode function needs only minor tweaks to handle
arbitrary buffers. Let's do those tweaks, which cleans up an
unreadable mess of temporary strings in http.c.

Signed-off-by: Jeff King &lt;peff@peff.net&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
</feed>
