<feed xmlns='http://www.w3.org/2005/Atom'>
<title>mirrors/foot.git/uri.c, branch master</title>
<subtitle>A fast, lightweight and minimalistic Wayland terminal emulator</subtitle>
<id>https://git.0x0f.dev/mirrors/foot.git/atom?h=master</id>
<link rel='self' href='https://git.0x0f.dev/mirrors/foot.git/atom?h=master'/>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/'/>
<updated>2026-05-22T09:00:48Z</updated>
<entry>
<title>uri-parse: fix out-of-bounds read with malformed %-encoded content</title>
<updated>2026-05-22T09:00:48Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2026-05-22T08:59:26Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=2eaa7beba1f35b31019a992de35be8a54b9ac028'/>
<id>urn:sha1:2eaa7beba1f35b31019a992de35be8a54b9ac028</id>
<content type='text'>
If the input URI ends with a trailing '%' (or a trailing '%N'), we
read outside the provided buffer.

On NULL terminated input, this happened to work out since we'd
correctly detect an invalid %-sequence as soon as we read the NULL
terminator.

On input that is not NULL terminated, we're out of luck.

This patch fixes this by also checking we have enough input left to
even _try_ to read the %-digits.

Also add unit tests for this particular case.

Closes #2353
</content>
</entry>
<entry>
<title>uri-parse: add a bunch of unit tests</title>
<updated>2026-05-22T08:49:22Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2026-05-22T08:49:22Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=5335cec3228dab421b2abba4f178125d88ad2fbe'/>
<id>urn:sha1:5335cec3228dab421b2abba4f178125d88ad2fbe</id>
<content type='text'>
</content>
</entry>
<entry>
<title>uri: check 'scheme' is non-null before de-referencing it</title>
<updated>2026-05-11T11:37:53Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2026-05-11T11:37:53Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=43566b655fee76947e0166d74a9dda4c03be26e6'/>
<id>urn:sha1:43566b655fee76947e0166d74a9dda4c03be26e6</id>
<content type='text'>
</content>
</entry>
<entry>
<title>uri: skip query/fragment parsing when dealing with file:// URIs</title>
<updated>2024-10-23T06:47:21Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2024-10-23T06:47:21Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=d68da27a7f869cb3c66d0e0b52c5559f1ceb3d3b'/>
<id>urn:sha1:d68da27a7f869cb3c66d0e0b52c5559f1ceb3d3b</id>
<content type='text'>
Also, ignore invalid query/fragments (i.e. if the fragment comes
before the query).

Closes #1840
</content>
</entry>
<entry>
<title>util: add streq() function and use in place of strcmp(...) == 0</title>
<updated>2024-02-05T11:09:52Z</updated>
<author>
<name>Craig Barnes</name>
<email>craigbarnes@protonmail.com</email>
</author>
<published>2024-01-24T23:17:28Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=e0f3703ae6c4084f9275cfc78d87e5604cc27a10'/>
<id>urn:sha1:e0f3703ae6c4084f9275cfc78d87e5604cc27a10</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Tag a couple variables with UNUSED, to fix warnings with clang-15</title>
<updated>2023-02-12T18:09:48Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2023-02-12T18:09:48Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=1c16e4a575713581140b81198c0a57dbbf5c0cc6'/>
<id>urn:sha1:1c16e4a575713581140b81198c0a57dbbf5c0cc6</id>
<content type='text'>
Closes #1278
</content>
</entry>
<entry>
<title>uri: move hex2nibble() to util.h</title>
<updated>2022-01-13T12:42:11Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2022-01-02T17:28:10Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=1a91cbecc7c3931f0b406fe9c4d5c98efc7d8863'/>
<id>urn:sha1:1a91cbecc7c3931f0b406fe9c4d5c98efc7d8863</id>
<content type='text'>
</content>
</entry>
<entry>
<title>uri: hostname_is_localhost(): don’t crash if hostname == NULL</title>
<updated>2021-06-19T13:56:39Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2021-06-19T13:56:39Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=1a755d0da2075ba0cccaaacd616f31eec697b08a'/>
<id>urn:sha1:1a755d0da2075ba0cccaaacd616f31eec697b08a</id>
<content type='text'>
</content>
</entry>
<entry>
<title>uri: switch to conservative maximum hostname length</title>
<updated>2021-01-21T11:00:02Z</updated>
<author>
<name>Jan Beich</name>
<email>jbeich@FreeBSD.org</email>
</author>
<published>2021-01-19T14:41:02Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=c531c6bc0e0e91722ec99da376d556af46b22bbc'/>
<id>urn:sha1:c531c6bc0e0e91722ec99da376d556af46b22bbc</id>
<content type='text'>
Current maximum is provided by sysconf(_SC_HOST_NAME_MAX) instead.

uri.c:269:20: error: use of undeclared identifier 'HOST_NAME_MAX'
    char this_host[HOST_NAME_MAX];
                   ^
</content>
</entry>
<entry>
<title>Print stack trace on assert() failure or when calling fatal_error()</title>
<updated>2021-01-16T19:56:33Z</updated>
<author>
<name>Craig Barnes</name>
<email>craigbarnes@protonmail.com</email>
</author>
<published>2021-01-15T20:39:45Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=22f25a9e4feddbc093ae01cd53bdda3c2c3a82e9'/>
<id>urn:sha1:22f25a9e4feddbc093ae01cd53bdda3c2c3a82e9</id>
<content type='text'>
Note: this uses the __sanitizer_print_stack_trace() function from the
AddressSanitizer runtime, so it only works when AddressSanitizer is
in use.
</content>
</entry>
<entry>
<title>uri: rename nibbletohex() function to hex2nibble()</title>
<updated>2021-01-04T05:31:19Z</updated>
<author>
<name>Craig Barnes</name>
<email>craigbarnes@protonmail.com</email>
</author>
<published>2021-01-04T05:31:19Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=b9a7cbf21daf00b21b2e2b516286761a39a9781b'/>
<id>urn:sha1:b9a7cbf21daf00b21b2e2b516286761a39a9781b</id>
<content type='text'>
It converts a hex digit to a nibble, not the other way around.
</content>
</entry>
<entry>
<title>uri: use nibble2hex() instead of isxdigit(3) to check valid hex digits</title>
<updated>2021-01-04T05:25:14Z</updated>
<author>
<name>Craig Barnes</name>
<email>craigbarnes@protonmail.com</email>
</author>
<published>2021-01-04T05:25:14Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=d30414b3a302cf9b409feb35086a14b4465d1ee5'/>
<id>urn:sha1:d30414b3a302cf9b409feb35086a14b4465d1ee5</id>
<content type='text'>
</content>
</entry>
<entry>
<title>codespell: fix misspelled words</title>
<updated>2020-10-28T18:34:49Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2020-10-28T18:34:49Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=bb43695426a769f6e471e6753017b3e60fb6edae'/>
<id>urn:sha1:bb43695426a769f6e471e6753017b3e60fb6edae</id>
<content type='text'>
</content>
</entry>
<entry>
<title>uri: add uri_parse() - new function extracts components from an URI</title>
<updated>2020-10-28T18:10:44Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2020-10-28T18:10:44Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=608cc746ad60bc2aa8db22814fe887fece4ea89b'/>
<id>urn:sha1:608cc746ad60bc2aa8db22814fe887fece4ea89b</id>
<content type='text'>
</content>
</entry>
</feed>
