|
|
Message-ID: <13a68b67-9b64-4f02-bfe1-8628cef7ada8@gmail.com>
Date: Thu, 19 Nov 2026 13:35:06 +0100
From: Bartosz Brachaczek <b.brachaczek@...il.com>
To: musl@...ts.openwall.com
Subject: Regression in wprintf_core in master
Hi,
I noticed a while ago that 7d358599d4c8f793cfb42ee49ff5e1d107de6ee4 was
never applied to wprintf_core but I never reported it, as it was
harmless in practice. This is an (obscure) problem in master now,
because since 3594657b88962d093e9d2a36ae0f3a11e758d6dd, the w==INT_MIN
case is handled with a goto overflow, and w may be assigned from
nl_arg[s[1]-'0'].i, which in the first run of wprintf_core (f==NULL) is
uninitialized. So, INT_MIN sitting at the right place on stack before
the call will cause the entire call to fail with EOVERFLOW.
As far as I can tell, just applying the same diff as
7d358599d4c8f793cfb42ee49ff5e1d107de6ee4 to vfwprintf.c should fix it.
I'm not attaching a patch, because I used an LLM to confirm my hunch and
create a repro. The repro is really trivial, so even though I used LLM
help to generate it, I'm attaching it. I ran it on x86_64. Please let me
know in case I shouldn't post similar repros in the future if an LLM was
used and/or just refrain from posting similar bug reports.
Bartosz
View attachment "repro.c" of type "text/plain" (194 bytes)
Powered by blists - more mailing lists
Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.