On 10/09/2020 05:32, Florian Weimer wrote:
> We have received a report that the glibc realpath implementation
> exhibits undefined behavior:
> 
>   <https://sourceware.org/bugzilla/show_bug.cgi?id=26592>
> 
> In gnulib, the code is in lib/canonicalize-lgpl.c:
> 
>     234           if (!ISSLASH (dest[-1]))
>     235             *dest++ = '/';
>     236 
>     237           if (dest + (end - start) >= rpath_limit)
>     238             {
>     239               ptrdiff_t dest_offset = dest - rpath;
>     240               char *new_rpath;

I think the lib/canonicalize.c is also affected:

204           if (!ISSLASH (dest[-1]))                                          
                         
205             *dest++ = '/';                                                  
                         
206 
207           if (dest + (end - start) >= rname_limit)                          
                         
208             {                                                               
                         
209               ptrdiff_t dest_offset = dest - rname;                         
                         
210               size_t new_size = rname_limit - rname;


On glibc side I will check if BZ#10635 is still applicable (to basically
sync gnulib and glibc implementation) and send some other realtime fixes
as well (BZ #26241, BZ #26592, and BZ #24970).

Reply via email to