This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Prevent out of bound access for multilib_options
- From: Graham Stott <graham dot stott at btinternet dot com>
- To: Kito Cheng <kito dot cheng at gmail dot com>, Jakub Jelinek <jakub at redhat dot com>
- Cc: "gcc-patches at gcc dot gnu dot org" <gcc-patches at gcc dot gnu dot org>, "rguenther at suse dot de" <rguenther at suse dot de>, "rsandifo at linux dot vnet dot ibm dot com" <rsandifo at linux dot vnet dot ibm dot com>
- Date: Wed, 9 Apr 2014 19:41:55 +0100 (BST)
- Subject: Re: [PATCH] Prevent out of bound access for multilib_options
- Authentication-results: sourceware.org; auth=none
- References: <CA+yXCZD=HHZrhbG068nLB2xmmSFsAaBMsFxZHcQ=+a8af-BVKw at mail dot gmail dot com> <20140409140311 dot GM1817 at tucnak dot redhat dot com> <CA+yXCZA81p-5h7M1pjhyHsn-_W1WbQV24_6gO9UOid867nzc3A at mail dot gmail dot com> <CA+yXCZDWKhTH72+ZtWyNCe7E2qSXP+fHz6iC4bVqx5cDLLD4LQ at mail dot gmail dot com>
- Reply-to: Graham Stott <graham dot stott at btinternet dot com>
All,
It happens with all mulitilib configurations not just arm-elf
if we have reached the end of the multilib_options string there are
no more options to process so break from the loop.
This patch is an alternative fix.
=================================
Index: gcc.c
============================
--- gcc.c (revision 209248)
+++ gcc.c (working copy)
@@ -7531,6 +7531,9 @@
}
break;
}
+
+ if (*q == '\0')
+ break;
}
}
}
============================
Graham