test: stacksmash: Make sure to change the value of the written byte
If the low byte of the stack cookie happens to be zero, we previously wouldn't trigger any error. This avoids accidentally failing to trigger the stack protector once per 256 runs, roughly.
This commit is contained in:
1 parent
b395a2f26b
commit
516c9779fb
1 file changed
+1
-1
+1
-1
@@ -20,7 +20,7 @@
|
||||
|
||||
__attribute__((noinline))
|
||||
void func(char *ptr, int idx) {
|
||||
ptr[idx] = 0;
|
||||
ptr[idx] ^= 1;
|
||||
}
|
||||
|
||||
int main(int argc, char *argv[]) {
|
||||
|
||||
Reference in new issue
Block a user