summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordoko <doko@6ca36cf4-e1d1-0310-8c6f-e303bb2178ca>2014-06-25 18:00:45 +0000
committerdoko <doko@6ca36cf4-e1d1-0310-8c6f-e303bb2178ca>2014-06-25 18:00:45 +0000
commit4b536fc71c5502d314af138f6e2b2630f1727a9f (patch)
tree20a1e9ef46f1bea3829507eabe525b8209ca0481
parent64d4fb607bd8283befb9298594665b27f4f614e0 (diff)
downloadgcc-48-4b536fc71c5502d314af138f6e2b2630f1727a9f.tar.gz
* 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
-rw-r--r--debian/changelog1
-rw-r--r--debian/patches/gcc-setmultilib-fix.diff22
-rw-r--r--debian/rules.patch1
3 files changed, 24 insertions, 0 deletions
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 <doko@debian.org> 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 \