Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <d0652416-09c8-453d-8205-92747688fcb2@linaro.org>
Date: Tue, 15 Oct 2024 15:29:14 -0300
From: Adhemerval Zanella Netto <adhemerval.zanella@...aro.org>
To: libc-coord@...ts.openwall.com, Alyssa Ross <hi@...ssa.is>
Subject: Re: sscanf("0x", "%x", &out)



On 15/10/24 15:19, Alyssa Ross wrote:
> This returns 1 with Glibc, and 0 with musl:
> 
> sscanf("0x", "%x", &out)
> 
> (I'm talking about the return value, not the value of out.)
> 
> This causes real world compatibility issues.  This test[1] fails,
> because bluetoothctl expects sscanf("0x01", "%2hhx", …) to return 1, and
> returns an error if it doesn't[2].
> 
> So, what's the right thing to do here?  The C standard is too dense for
> me.
> 
> [1]: https://github.com/martinpitt/python-dbusmock/blob/1ae426c687ee48c92ba1a4e27778f217040d7180/tests/test_bluez5.py#L496
> [2]: https://git.kernel.org/pub/scm/bluetooth/bluez.git/tree/client/adv_monitor.c?id=32e9d15a60948ad1e912f6660e9dea6d8c5265d1#n454

I think this is BZ#12701 [1] and a glibc conformance issue
from Joseph's comment [2] (which I agree).

[1] https://sourceware.org/bugzilla/show_bug.cgi?id=12701
[2] https://sourceware.org/bugzilla/show_bug.cgi?id=12701#c13

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.