* gcc.c (make_relative_prefix): Allocate a sufficiently large
buffer.
From-SVN: r45049
+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.
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)