diff options
author | Stuart Hastings <stuart@apple.com> | 2005-01-21 23:16:45 +0000 |
---|---|---|
committer | Stuart Hastings <stuart@apple.com> | 2005-01-21 23:16:45 +0000 |
commit | adfa30a04e230677175816f7ecb18dbe1e186909 (patch) | |
tree | 31bfe3f0f0a894340925653f4f4139735a028df5 | |
parent | 69a171a1ae147c934208bfc213ad95cdcaaad13e (diff) |
2005-01-21 Stuart Hastings <stuart@apple.com>
Radar 3959753
* gcc/gcc.c (process_command): Malloc overflowing static char array.
git-svn-id: https://gcc.gnu.org/svn/gcc/branches/apple-gcc_os_35-branch@94046 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r-- | gcc/ChangeLog.apple-ppc | 5 | ||||
-rw-r--r-- | gcc/gcc.c | 9 |
2 files changed, 11 insertions, 3 deletions
diff --git a/gcc/ChangeLog.apple-ppc b/gcc/ChangeLog.apple-ppc index 61fb1a0e369..11b5731da95 100644 --- a/gcc/ChangeLog.apple-ppc +++ b/gcc/ChangeLog.apple-ppc @@ -1,3 +1,8 @@ +2005-01-21 Stuart Hastings <stuart@apple.com> + + Radar 3959753 + * gcc/gcc.c (process_command): Malloc overflowing static char array. + 2005-01-20 Dale Johannesen <dalej@apple.com> Radar 3966230 diff --git a/gcc/gcc.c b/gcc/gcc.c index b0d4d6b975c..8dddb6d2a6f 100644 --- a/gcc/gcc.c +++ b/gcc/gcc.c @@ -1,6 +1,6 @@ /* Compiler driver program that can handle many languages. Copyright (C) 1987, 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998, - 1999, 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc. + 1999, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. This file is part of GCC. @@ -4113,10 +4113,13 @@ warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n\n" /* Synthesize the deployment target manifest constant. */ if (macosx_version_min_required) { - char macro_def[40]; +#define VERSION_MIN_REQUIRED_FMT "-D__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__=%d" + char *macro_def = xmalloc (strlen (VERSION_MIN_REQUIRED_FMT) + 30); - sprintf (macro_def, "-D__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__=%d", macosx_version_min_required); + sprintf (macro_def, VERSION_MIN_REQUIRED_FMT, macosx_version_min_required); add_preprocessor_option (macro_def, strlen (macro_def)); + free (macro_def); +#undef VERSION_MIN_REQUIRED_FMT } /* APPLE LOCAL end deployment target */ |