mirror of
git://sourceware.org/git/glibc.git
synced 2024-11-21 01:12:26 +08:00
* posix/execl.c: Fix last argument of memcpy. Reported by Brian
Sumner <bls@sgi.com>. * posix/execlp.c: Likewise.
This commit is contained in:
parent
23382b36a7
commit
0f5660af02
@ -52,7 +52,8 @@ execl (const char *path, const char *arg, ...)
|
||||
if ((char *) nptr + argv_max == (char *) argv)
|
||||
{
|
||||
/* Stack grows down. */
|
||||
argv = (const char **) memcpy (nptr, argv, i);
|
||||
argv = (const char **) memcpy (nptr, argv,
|
||||
i * sizeof (const char *));
|
||||
argv_max += i;
|
||||
}
|
||||
else
|
||||
@ -64,7 +65,8 @@ execl (const char *path, const char *arg, ...)
|
||||
else
|
||||
#endif
|
||||
/* We have a hole in the stack. */
|
||||
argv = (const char **) memcpy (nptr, argv, i);
|
||||
argv = (const char **) memcpy (nptr, argv,
|
||||
i * sizeof (const char *));
|
||||
}
|
||||
|
||||
argv[i] = va_arg (args, const char *);
|
||||
|
@ -49,7 +49,8 @@ execlp (const char *file, const char *arg, ...)
|
||||
if ((char *) nptr + argv_max == (char *) argv)
|
||||
{
|
||||
/* Stack grows down. */
|
||||
argv = (const char **) memcpy (nptr, argv, i);
|
||||
argv = (const char **) memcpy (nptr, argv,
|
||||
i * sizeof (const char *));
|
||||
argv_max += i;
|
||||
}
|
||||
else
|
||||
@ -61,7 +62,8 @@ execlp (const char *file, const char *arg, ...)
|
||||
else
|
||||
#endif
|
||||
/* We have a hole in the stack. */
|
||||
argv = (const char **) memcpy (nptr, argv, i);
|
||||
argv = (const char **) memcpy (nptr, argv,
|
||||
i * sizeof (const char *));
|
||||
}
|
||||
|
||||
argv[i] = va_arg (args, const char *);
|
||||
|
Loading…
Reference in New Issue
Block a user