[PATCH] canonicalize: Initialize 'dest' pointer in 'realpath_stk' [BZ #32577]

Adhemerval Zanella Netto adhemerval.zanella@linaro.org
Mon Jan 20 12:22:16 GMT 2025



On 20/01/25 06:54, Xi Ruoyao wrote:
> On Mon, 2025-01-20 at 10:24 +0100, Nikhil R wrote:
>> From: Nikhil R <nikhilr5@kpit.com>
>>
>> Fixes a GCC warning when compiling with the '-Os' optimization flag:
>>> canonicalize.c: In function 'realpath_stk':
>>> canonicalize.c:424:50: error: 'dest' may be used uninitialized in
>>> this function [-Werror=maybe-uninitialized]
>>>   424 |   return scratch_buffer_dupfree (rname_buf, dest - rname);
> 
> This line does not exist in the latest Glibc code base.  Please recheck
> with the master branch.
>

The bug report is against glibc 2.35, and since then there were multiples
fixes that changed the implementation a lot.  I think ef0700004bf0dccf493
should be main change that avoid this warning, but it would require to
backport 949ad78a189194048 and b416555431b47a21.



More information about the Libc-alpha mailing list