This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug middle-end/78433] [7 Regression] glibc posix/execvpe.c gets miscompiled with -O3


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

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]