Fix modify_stack_protector flake
The previous test would fail to crash if the first byte of the canary was already NUL (1 of 256 runs assuming uniform canary distribution). Bug: http://b/121156651 Test: bionic unit tests
This commit is contained in:
parent
7bd54ade8d
commit
76e7fd4e26
|
@ -21,6 +21,6 @@ __attribute__((noinline)) void modify_stack_protector_test() {
|
|||
// the line of defense *after* that.
|
||||
// Without volatile, the generic x86/x86-64 targets don't write to the stack.
|
||||
volatile char* p = buf;
|
||||
int size = static_cast<int>(sizeof(buf) + 1);
|
||||
int size = static_cast<int>(sizeof(buf) + sizeof(void*));
|
||||
while ((p - buf) < size) *p++ = '\0';
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue