From 4b536fc71c5502d314af138f6e2b2630f1727a9f Mon Sep 17 00:00:00 2001 From: doko Date: Wed, 25 Jun 2014 18:00:45 +0000 Subject: * Fix a segfault in the driver from calling free on non-malloc'd area. git-svn-id: svn://svn.debian.org/svn/gcccvs/branches/sid/gcc-4.8@7476 6ca36cf4-e1d1-0310-8c6f-e303bb2178ca --- debian/changelog | 1 + debian/patches/gcc-setmultilib-fix.diff | 22 ++++++++++++++++++++++ debian/rules.patch | 1 + 3 files changed, 24 insertions(+) create mode 100644 debian/patches/gcc-setmultilib-fix.diff diff --git a/debian/changelog b/debian/changelog index 4cd639e..c04982c 100644 --- a/debian/changelog +++ b/debian/changelog @@ -7,6 +7,7 @@ gcc-4.8 (4.8.3-4) UNRELEASED; urgency=medium [ Matthias Klose ] * Fix removal of python byte-code files in libstdc++6. Addresses: #751435. + * Fix a segfault in the driver from calling free on non-malloc'd area. -- Matthias Klose Mon, 16 Jun 2014 09:28:11 +0200 diff --git a/debian/patches/gcc-setmultilib-fix.diff b/debian/patches/gcc-setmultilib-fix.diff new file mode 100644 index 0000000..950057b --- /dev/null +++ b/debian/patches/gcc-setmultilib-fix.diff @@ -0,0 +1,22 @@ +--- a/src/gcc/gcc.c ++++ b/src/gcc/gcc.c +@@ -8038,10 +8038,15 @@ + q2++; + if (*q2 == ':') + ml_end = q2; +- new_multilib_os_dir = XNEWVEC (char, ml_end - q); +- memcpy (new_multilib_os_dir, q + 1, ml_end - q - 1); +- new_multilib_os_dir[ml_end - q - 1] = '\0'; +- multilib_os_dir = *new_multilib_os_dir ? new_multilib_os_dir : "."; ++ if (ml_end - q == 1) ++ multilib_os_dir = xstrdup ("."); ++ else ++ { ++ new_multilib_os_dir = XNEWVEC (char, ml_end - q); ++ memcpy (new_multilib_os_dir, q + 1, ml_end - q - 1); ++ new_multilib_os_dir[ml_end - q - 1] = '\0'; ++ multilib_os_dir = new_multilib_os_dir; ++ } + + if (q2 < end && *q2 == ':') + { diff --git a/debian/rules.patch b/debian/rules.patch index b0dce31..ed490d9 100644 --- a/debian/rules.patch +++ b/debian/rules.patch @@ -98,6 +98,7 @@ debian_patches += \ libitm-aarch64 \ pr61046 \ pr61336 \ + gcc-setmultilib-fix \ # FIXME: still necessary for cross building the native compiler? # gcc-auto-build \ -- cgit v1.2.3