r277845 - in /trunk/gcc: ChangeLog config/aarch...

matmal01@gcc.gnu.org matmal01@gcc.gnu.org
Tue Nov 5 15:35:00 GMT 2019


Author: matmal01
Date: Tue Nov  5 15:35:15 2019
New Revision: 277845

URL: https://gcc.gnu.org/viewcvs?rev=277845&root=gcc&view=rev
Log:
[aarch64] Allocate space for err_str in aarch64_handle_attr_branch_protection


-fsanitize=hwaddress found a one-byte overwrite when running the
testsuite here.  aarch64_handle_attr_branch_protection allocates
`strlen(str)` bytes for an error string, which is populated by
`strcpy(..., str)` in the case where the branch protection string is
completely invalid.

Not tested -- I don't want to re-build and it seems obvious.

gcc/ChangeLog:

2019-11-05  Matthew Malcomson  <matthew.malcomson@arm.com>

	* config/aarch64/aarch64.c (aarch64_handle_attr_cpu): Allocate
	enough bytes for the NULL character.

Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/config/aarch64/aarch64.c



More information about the Gcc-cvs mailing list