author | Nick Kralevich <nnk@google.com> | |
Wed, 2 Oct 2013 21:14:40 +0000 (14:14 -0700) | ||
committer | Nick Kralevich <nnk@google.com> | |
Wed, 2 Oct 2013 21:14:40 +0000 (14:14 -0700) | ||
commit | b91791d71c58d14309cd4d842d222f5d36b3a5a8 | |
tree | f4ff8e8fbbe7fa01b34f6b2bf82ec0a78146607e | tree | snapshot (tar.xz tar.gz zip) |
parent | 4bbf3a8b558ea8b5ce62f2d1ee2599a8e95c21c0 | commit | diff |
Use alloc_size attribute on *alloc functions
malloc and family were not declared with __attribute__((alloc_size)).
This was (sometimes) preventing FORTIFY_SOURCE related functions
from knowing the size of the buffer it's dealing with, inhibiting
FORTIFY_SOURCE protections.
Add __attribute__((alloc_size))
Information about the alloc_size attribute can be found
at http://gcc.gnu.org/onlinedocs/gcc/Function-Attributes.html
Change-Id: Ia2f0a445f0170a7325f69259b5e7fb35a9f14921
malloc and family were not declared with __attribute__((alloc_size)).
This was (sometimes) preventing FORTIFY_SOURCE related functions
from knowing the size of the buffer it's dealing with, inhibiting
FORTIFY_SOURCE protections.
Add __attribute__((alloc_size))
Information about the alloc_size attribute can be found
at http://gcc.gnu.org/onlinedocs/gcc/Function-Attributes.html
Change-Id: Ia2f0a445f0170a7325f69259b5e7fb35a9f14921
libc/include/malloc.h | diff | blob | history | |
tests/fortify_test.cpp | diff | blob | history |