summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: fec6052)
raw | patch | inline | side by side (parent: fec6052)
author | Yabin Cui <yabinc@google.com> | |
Thu, 11 Dec 2014 22:35:05 +0000 (14:35 -0800) | ||
committer | Yabin Cui <yabinc@google.com> | |
Fri, 12 Dec 2014 01:24:55 +0000 (17:24 -0800) |
tests/stack_protector_test.cpp | patch | blob | history |
index aad51ecff37f1842652d202c878f6d7396a6c4e6..80077113be3859b97e4acb6a6e333ab272ee95cf 100644 (file)
* This must be marked with "__attribute__ ((noinline))", to ensure the
* compiler generates the proper stack guards around this function.
*/
+static char* dummy_buf;
+
__attribute__ ((noinline))
static void do_modify_stack_chk_guard() {
+ char buf[128];
+ // Store local array's address to global variable to force compiler to generate stack guards.
+ dummy_buf = buf;
__stack_chk_guard = 0x12345678;
}
+
#endif
TEST(stack_protector, global_guard) {