<feed xmlns='http://www.w3.org/2005/Atom'>
<title>musl/src, branch master</title>
<subtitle>musl - an implementation of the standard library for Linux-based systems</subtitle>
<link rel='alternate' type='text/html' href='http://git.musl-libc.org/cgit/musl/'/>
<entry>
<title>fnmatch: fix FNM_PERIOD failure of escaped '.' to match leading '.'</title>
<updated>2026-09-21T13:15:22+00:00</updated>
<author>
<name>Rich Felker</name>
<email>dalias@aerifal.cx</email>
</author>
<published>2026-09-21T13:15:22+00:00</published>
<link rel='alternate' type='text/html' href='http://git.musl-libc.org/cgit/musl/commit/?id=c4e1bb3994c14ed5112c894d15a451bf00f0d501'/>
<id>c4e1bb3994c14ed5112c894d15a451bf00f0d501</id>
<content type='text'>
the new condition also allows forward progress into ordinary matching
if the pattern begins with a backslash. this is fine independent of
FNM_NOESCAPE and independent of what follows the backslash; if
FNM_NOESCAPE is active, the backslash is literal and will not match.
if FNM_NOESCAPE is not active, the pattern beginning with a backslash
ensures that the first character is literal.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
the new condition also allows forward progress into ordinary matching
if the pattern begins with a backslash. this is fine independent of
FNM_NOESCAPE and independent of what follows the backslash; if
FNM_NOESCAPE is active, the backslash is literal and will not match.
if FNM_NOESCAPE is not active, the pattern beginning with a backslash
ensures that the first character is literal.
</pre>
</div>
</content>
</entry>
<entry>
<title>asprintf: always clear the result pointer on failure</title>
<updated>2026-09-17T15:58:23+00:00</updated>
<author>
<name>Rich Felker</name>
<email>dalias@aerifal.cx</email>
</author>
<published>2026-09-17T15:58:23+00:00</published>
<link rel='alternate' type='text/html' href='http://git.musl-libc.org/cgit/musl/commit/?id=be5ba5695df9197365cdb1c95b12fa423059ce34'/>
<id>be5ba5695df9197365cdb1c95b12fa423059ce34</id>
<content type='text'>
previously, the malloc-failure error path cleared it, but other
failures from vsnprintf such as EILSEQ or EOVERFLOW left the original
contents of the result object in place.

leaving any old value in place is allowed, and would be required if
the specification did not explicitly permit clobbering it on failure,
but it does.

by overwriting any old value there with a null pointer, we harden
callers that might have failed to check the return value for errors
against accessing and possibly exposing unrelated data; instead they
will fault on dereference.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
previously, the malloc-failure error path cleared it, but other
failures from vsnprintf such as EILSEQ or EOVERFLOW left the original
contents of the result object in place.

leaving any old value in place is allowed, and would be required if
the specification did not explicitly permit clobbering it on failure,
but it does.

by overwriting any old value there with a null pointer, we harden
callers that might have failed to check the return value for errors
against accessing and possibly exposing unrelated data; instead they
will fault on dereference.
</pre>
</div>
</content>
</entry>
<entry>
<title>fix printf handling of indirect (asterisk) field width of INT_MIN</title>
<updated>2026-09-16T17:55:04+00:00</updated>
<author>
<name>Rich Felker</name>
<email>dalias@aerifal.cx</email>
</author>
<published>2026-09-16T17:55:04+00:00</published>
<link rel='alternate' type='text/html' href='http://git.musl-libc.org/cgit/musl/commit/?id=3594657b88962d093e9d2a36ae0f3a11e758d6dd'/>
<id>3594657b88962d093e9d2a36ae0f3a11e758d6dd</id>
<content type='text'>
in this case, negation produces integer overflow. since a field width
of the faithfully negated value would necessarily overflow INT_MAX,
just detect this case and immediately treat it as an output overflow
error.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
in this case, negation produces integer overflow. since a field width
of the faithfully negated value would necessarily overflow INT_MAX,
just detect this case and immediately treat it as an output overflow
error.
</pre>
</div>
</content>
</entry>
<entry>
<title>vfwscanf: consistently use MB_LEN_MAX instead of magic number 4</title>
<updated>2026-09-10T21:12:14+00:00</updated>
<author>
<name>Rich Felker</name>
<email>dalias@aerifal.cx</email>
</author>
<published>2026-09-10T21:12:14+00:00</published>
<link rel='alternate' type='text/html' href='http://git.musl-libc.org/cgit/musl/commit/?id=9ec8ef2c6c8a6204211a38b842b497385488e2c6'/>
<id>9ec8ef2c6c8a6204211a38b842b497385488e2c6</id>
<content type='text'>
this magic number 4 is what ensures the next wctomb won't overflow the
allocated buffer, but its purpose wasn't clear.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
this magic number 4 is what ensures the next wctomb won't overflow the
allocated buffer, but its purpose wasn't clear.
</pre>
</div>
</content>
</entry>
<entry>
<title>stdio: reserve multibyte space in allocated vfwscanf %c conversions</title>
<updated>2026-09-10T21:06:09+00:00</updated>
<author>
<name>Matthias Goergens</name>
<email>matthias.goergens@gmail.com</email>
</author>
<published>2026-08-05T14:09:54+00:00</published>
<link rel='alternate' type='text/html' href='http://git.musl-libc.org/cgit/musl/commit/?id=c2541fd53fa6c972d6cc8974f3574b3fed5aa81e'/>
<id>c2541fd53fa6c972d6cc8974f3574b3fed5aa81e</id>
<content type='text'>
Allocated narrow %c conversions initially reserve only width+1 bytes.
For the default width this is two bytes, but in a UTF-8 locale wctomb
can write up to MB_LEN_MAX bytes into the buffer before the
post-conversion growth check, overflowing the two-byte allocation for
a three- or four-byte input character.

Ensure every allocated narrow buffer starts at no less than
MB_LEN_MAX bytes.  The existing geometric growth then keeps at least
MB_LEN_MAX spare bytes available after each conversion.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Allocated narrow %c conversions initially reserve only width+1 bytes.
For the default width this is two bytes, but in a UTF-8 locale wctomb
can write up to MB_LEN_MAX bytes into the buffer before the
post-conversion growth check, overflowing the two-byte allocation for
a three- or four-byte input character.

Ensure every allocated narrow buffer starts at no less than
MB_LEN_MAX bytes.  The existing geometric growth then keeps at least
MB_LEN_MAX spare bytes available after each conversion.
</pre>
</div>
</content>
</entry>
<entry>
<title>vf[w]scanf: fix integer overflow in %mlc allocation with large width</title>
<updated>2026-09-10T20:50:31+00:00</updated>
<author>
<name>Rich Felker</name>
<email>dalias@aerifal.cx</email>
</author>
<published>2026-09-10T20:50:31+00:00</published>
<link rel='alternate' type='text/html' href='http://git.musl-libc.org/cgit/musl/commit/?id=7d7b03b8e8dbecadc6b790444b91fa62929c257c'/>
<id>7d7b03b8e8dbecadc6b790444b91fa62929c257c</id>
<content type='text'>
on archs with 32-bit size_t, multiplying the caller-provided signed
int field width by sizeof(wchar_t) can overflow.

we could explicitly error out, but just replacing the requested size
to let malloc fail avoids the need to poke at errno, and the rest of
the function here is already using guaranteed-fail in the geometric
buffer growth path to avoid explicit size checks.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
on archs with 32-bit size_t, multiplying the caller-provided signed
int field width by sizeof(wchar_t) can overflow.

we could explicitly error out, but just replacing the requested size
to let malloc fail avoids the need to poke at errno, and the rest of
the function here is already using guaranteed-fail in the geometric
buffer growth path to avoid explicit size checks.
</pre>
</div>
</content>
</entry>
<entry>
<title>wordexp: clear positional parameters</title>
<updated>2026-09-10T00:16:02+00:00</updated>
<author>
<name>Szabolcs Nagy</name>
<email>nsz@port70.net</email>
</author>
<published>2026-06-21T12:18:51+00:00</published>
<link rel='alternate' type='text/html' href='http://git.musl-libc.org/cgit/musl/commit/?id=331cf27023e20813a5c634be47f55c1a490aa827'/>
<id>331cf27023e20813a5c634be47f55c1a490aa827</id>
<content type='text'>
added 'set --' so $@, $*, $#, $1, $2 are cleared
(does not seem to be in the spec, but cleaner)

  wordexp("$*", p, 0)

was "$*","2&gt;/dev/stderr", now empty list.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
added 'set --' so $@, $*, $#, $1, $2 are cleared
(does not seem to be in the spec, but cleaner)

  wordexp("$*", p, 0)

was "$*","2&gt;/dev/stderr", now empty list.
</pre>
</div>
</content>
</entry>
<entry>
<title>wordexp: fix stderr redirection</title>
<updated>2026-09-10T00:15:15+00:00</updated>
<author>
<name>Szabolcs Nagy</name>
<email>nsz@port70.net</email>
</author>
<published>2026-06-21T11:33:28+00:00</published>
<link rel='alternate' type='text/html' href='http://git.musl-libc.org/cgit/musl/commit/?id=235f72897aa48a47066e40d8ade1693659627783'/>
<id>235f72897aa48a47066e40d8ade1693659627783</id>
<content type='text'>
stderr redirection to /dev/null didn't work, can be done in the
command, but would not redirect errors printed during sh startup.

  wordexp(")", p, 0)

clobbered stderr, now silent.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
stderr redirection to /dev/null didn't work, can be done in the
command, but would not redirect errors printed during sh startup.

  wordexp(")", p, 0)

clobbered stderr, now silent.
</pre>
</div>
</content>
</entry>
<entry>
<title>fix undefined pointer arithmetic in wcsrchr</title>
<updated>2026-09-09T23:44:20+00:00</updated>
<author>
<name>Matthias Goergens</name>
<email>matthias.goergens@gmail.com</email>
</author>
<published>2026-08-05T07:57:55+00:00</published>
<link rel='alternate' type='text/html' href='http://git.musl-libc.org/cgit/musl/commit/?id=15a1155eafd1d8c13bc1b5ed360cec0b6610dfdd'/>
<id>15a1155eafd1d8c13bc1b5ed360cec0b6610dfdd</id>
<content type='text'>
On an unsuccessful search, the backwards loop decrements the pointer
past the beginning of the string and then compares that invalid pointer
with the string pointer.

Check for the beginning of the string before decrementing instead. This
preserves the existing results without forming a pointer outside the
array.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
On an unsuccessful search, the backwards loop decrements the pointer
past the beginning of the string and then compares that invalid pointer
with the string pointer.

Check for the beginning of the string before decrementing instead. This
preserves the existing results without forming a pointer outside the
array.
</pre>
</div>
</content>
</entry>
<entry>
<title>mntent: avoid undefined behavior on long lines</title>
<updated>2026-09-09T23:43:42+00:00</updated>
<author>
<name>Matthias Goergens</name>
<email>matthias.goergens@gmail.com</email>
</author>
<published>2026-08-05T08:03:25+00:00</published>
<link rel='alternate' type='text/html' href='http://git.musl-libc.org/cgit/musl/commit/?id=ba6961dd5053874d2e4ae05ce4c8685ba0131e0a'/>
<id>ba6961dd5053874d2e4ae05ce4c8685ba0131e0a</id>
<content type='text'>
The continue for lines longer than INT_MAX reaches the do-while
condition without initializing n. On the first such line, the condition
reads indeterminate values. After an earlier line, it reuses stale
offsets from that line.

Jump directly to the start of the loop instead. This is the minimal form
requested in the previous review and preserves the intended behavior of
skipping an overlong line.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The continue for lines longer than INT_MAX reaches the do-while
condition without initializing n. On the first such line, the condition
reads indeterminate values. After an earlier line, it reuses stale
offsets from that line.

Jump directly to the start of the loop instead. This is the minimal form
requested in the previous review and preserves the intended behavior of
skipping an overlong line.
</pre>
</div>
</content>
</entry>
</feed>
