gcc.c (make_relative_prefix): Allocate a sufficiently large buffer.

* gcc.c (make_relative_prefix): Allocate a sufficiently large
	buffer.

From-SVN: r45049
This commit is contained in:
Matt Kraai 2001-08-20 13:39:36 +00:00 committed by Matt Kraai
parent 2a895e441a
commit 27a1448728
2 changed files with 11 additions and 2 deletions

View File

@ -1,3 +1,8 @@
2001-08-20 Matt Kraai <kraai@alumni.carnegiemellon.edu>
* gcc.c (make_relative_prefix): Allocate a sufficiently large
buffer.
2001-08-20 Richard Henderson <rth@redhat.com>
* final.c (end_final): Fix typo last change.

View File

@ -2285,8 +2285,12 @@ make_relative_prefix (progname, bin_prefix, prefix)
GET_ENV_PATH_LIST (temp, "PATH");
if (temp)
{
char *startp, *endp;
char *nstore = (char *) alloca (strlen (temp) + strlen (progname) + 1);
char *startp, *endp, *nstore;
size_t prefixlen = strlen (temp) + 1;
if (prefixlen < 2)
prefixlen = 2;
nstore = (char *) alloca (prefixlen + strlen (progname) + 1);
startp = endp = temp;
while (1)