From: Andreas Schwab Date: Fri, 14 Sep 2001 10:14:51 +0000 (+0000) Subject: * posix/execl.c: Fix last argument of memcpy. Reported by Brian X-Git-Tag: upstream/2.20~15484 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=0f5660af02985db9a61a6ffeb9b1dc449e78a35c;p=platform%2Fupstream%2Flinaro-glibc.git * posix/execl.c: Fix last argument of memcpy. Reported by Brian Sumner . * posix/execlp.c: Likewise. --- diff --git a/posix/execl.c b/posix/execl.c index e831f54..72748a4 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 6b9f211..9507056 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 *);