alsatplg broken with musl-libc

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



alsa-project/alsa-lib issue #187 was opened from Johnnynator:

alsatplg feeds empty and non Integer strings to `strtol(3)` and friends. Glibc just silently accepts such inputs and does not set errno and returns 0. Musl sets `errno` to `EINVAL` with such inputs.
This can easily be seen by most of the `alsatplg` invocation when compiling https://github.com/thesofproject/sof/

`STRTOL(3)` manpage explains that this behavior is allowed.
>  The implementation may also set errno to EINVAL in case no conversion
    was performed (no digits seen, and 0 returned).

There are like two ways I see this can be fixed

a) ignore EINVAL (and check if base is correct ourself)
b) make sure that strtol is only getting called with a valid input (I'm not sure if the current behavior is intended to just return 0 if e,g, `tplg_get_unsigned` did not even parse anything valid

Issue URL     : https://github.com/alsa-project/alsa-lib/issues/187
Repository URL: https://github.com/alsa-project/alsa-lib



[Index of Archives]     [ALSA User]     [Linux Audio Users]     [Pulse Audio]     [Kernel Archive]     [Asterisk PBX]     [Photo Sharing]     [Linux Sound]     [Video 4 Linux]     [Gimp]     [Yosemite News]

  Powered by Linux