[PATCH] ldd: define the unused variable
Carlos O'Donell
carlos@redhat.com
Mon Sep 15 13:18:18 GMT 2025
On 9/12/25 4:15 PM, Sam James wrote:
> Aurelien Jarno <aurelien@aurel32.net> writes:
>
>> The unused variable could be use unitialized, which is an issue if ldd
>> is ran with "-u". Fix that by defining the variable to an empty value,
>> just like it is already done for the bind_now, warn and verbose
>> variables.
>>
>> Reported-by: Johan Palmqvist <johan.palmqvist@gmail.com>
>
> In general, I'm sceptical of enforcing -u on projects that haven't
> asked for it, but the fix is simple and as you say, it's consistent, so:
Agreed. Reviewed this morning in the patch queue review. Please push this.
> Reviewed-by: Sam James <sam@gentoo.org>
>
>> ---
>> elf/ldd.bash.in | 1 +
>> 1 file changed, 1 insertion(+)
>>
>> diff --git a/elf/ldd.bash.in b/elf/ldd.bash.in
>> index 2d3df6e57e..fdf6704012 100644
>> --- a/elf/ldd.bash.in
>> +++ b/elf/ldd.bash.in
>> @@ -30,6 +30,7 @@ RTLDLIST=@RTLD@
>> warn=
>> bind_now=
>> verbose=
>> +unused=
>>
>> while test $# -gt 0; do
>> case "$1" in
>
--
Cheers,
Carlos.
More information about the Libc-alpha
mailing list