summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Schwab <schwab@suse.de>2001-09-14 10:14:51 +0000
committerAndreas Schwab <schwab@suse.de>2001-09-14 10:14:51 +0000
commit0f5660af02985db9a61a6ffeb9b1dc449e78a35c (patch)
tree202b3b64d453240e220e7d6659cf63d75933a8f3
parent23382b36a7f28c5205edd77bacf00fa7cbee9d53 (diff)
downloadglibc-0f5660af02985db9a61a6ffeb9b1dc449e78a35c.tar.gz
* posix/execl.c: Fix last argument of memcpy. Reported by Brian
Sumner <bls@sgi.com>. * posix/execlp.c: Likewise.
-rw-r--r--posix/execl.c6
-rw-r--r--posix/execlp.c6
2 files changed, 8 insertions, 4 deletions
diff --git a/posix/execl.c b/posix/execl.c
index e831f5452f..72748a456f 100644
--- a/posix/execl.c
+++ b/posix/execl.c
@@ -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 *);
diff --git a/posix/execlp.c b/posix/execlp.c
index 6b9f211ed0..950705604c 100644
--- a/posix/execlp.c
+++ b/posix/execlp.c
@@ -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 *);