projects
/
platform
/
upstream
/
glibc.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
a41301f
)
(execvp): Correct copying of file name.
author
Ulrich Drepper
<drepper@redhat.com>
Mon, 23 Aug 1999 22:20:34 +0000
(22:20 +0000)
committer
Ulrich Drepper
<drepper@redhat.com>
Mon, 23 Aug 1999 22:20:34 +0000
(22:20 +0000)
posix/execvp.c
patch
|
blob
|
history
diff --git
a/posix/execvp.c
b/posix/execvp.c
index 27568294a551e5bc370112cb8326129002b95839..963b769fca1871d5cce369605ab54ec83d68e79c 100644
(file)
--- a/
posix/execvp.c
+++ b/
posix/execvp.c
@@
-79,6
+79,7
@@
execvp (file, argv)
int got_eacces = 0;
char *path, *p, *name;
size_t len;
+ size_t pathlen;
path = getenv ("PATH");
if (path == NULL)
@@
-93,9
+94,10
@@
execvp (file, argv)
}
len = strlen (file) + 1;
- name = __alloca (strlen (path) + len + 1);
+ pathlen = strlen (path);
+ name = __alloca (pathlen + len + 1);
/* Copy the file name at the top. */
- name = (char *) memcpy (name
- len
, file, len);
+ name = (char *) memcpy (name
+ pathlen + 1
, file, len);
/* And add the slash. */
*--name = '/';