diff options
author | Joseph Myers <joseph@codesourcery.com> | 2023-04-26 17:14:18 +0000 |
---|---|---|
committer | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2023-04-27 01:27:28 +0200 |
commit | af16a59ee1f72392b88d439d8f802c9844f86f4f (patch) | |
tree | b1545d20010800e1c8368b64d0ceeb854d2351d3 /elf | |
parent | bcca5ae8049efd98ef11f45cf0f1fcea661b3cc1 (diff) | |
download | glibc-af16a59ee1f72392b88d439d8f802c9844f86f4f.zip glibc-af16a59ee1f72392b88d439d8f802c9844f86f4f.tar.gz glibc-af16a59ee1f72392b88d439d8f802c9844f86f4f.tar.bz2 |
Fix Hurd getcwd build with GCC >= 13
The build of glibc for i686-gnu has been failing for a while with GCC
mainline / GCC 13:
../sysdeps/mach/hurd/getcwd.c: In function '__hurd_canonicalize_directory_name_internal':
../sysdeps/mach/hurd/getcwd.c:242:48: error: pointer 'file_name' may be used after 'realloc' [-Werror=use-after-free]
242 | file_namep = &buf[file_namep - file_name + size / 2];
| ~~~~~~~~~~~^~~~~~~~~~~
../sysdeps/mach/hurd/getcwd.c:236:25: note: call to 'realloc' here
236 | buf = realloc (file_name, size);
| ^~~~~~~~~~~~~~~~~~~~~~~~~
Fix by doing the subtraction before the reallocation.
Tested with build-many-glibcs.py for i686-gnu.
[samuel.thibault@ens-lyon.rg: Removed mention of this being a bug]
Message-Id: <18587337-7815-4056-ebd0-724df262d591@codesourcery.com>
Diffstat (limited to 'elf')
0 files changed, 0 insertions, 0 deletions