This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug middle-end/78433] [7 Regression] glibc posix/execvpe.c gets miscompiled with -O3
- From: "vogt at linux dot vnet.ibm.com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Mon, 21 Nov 2016 10:51:13 +0000
- Subject: [Bug middle-end/78433] [7 Regression] glibc posix/execvpe.c gets miscompiled with -O3
- Auto-submitted: auto-generated
- References: <bug-78433-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78433
--- Comment #9 from Dominik Vogt <vogt at linux dot vnet.ibm.com> ---
... and I think the buffer allocated in __execvpe() is also one byte too small:
char buffer[path_len + file_len + 1];
...
char *pend = mempcpy (buffer, p, subp - p); <-- path_len
*pend = '/'; <-- path_len + 1
memcpy (pend + (p < subp), file, file_len + 1); <-- path_len + file_len + 2