Skip to content

Commit

Permalink
test(ndk): manually cause a stack-overflow in CXXStackoverflowScenari…
Browse files Browse the repository at this point in the history
…o to avoid strcnpy_chk
  • Loading branch information
lemnik committed May 30, 2024
1 parent be7c857 commit b21630a
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,13 @@
extern "C" {
int __attribute__((optnone)) __attribute__((noinline)) crash_stack_overflow(int counter, char *input) {
char stack[7];
char *output = stack;

strcpy(stack, input);
while (*input) {
*output = *input;
input++;
output++;
}

return 4 / counter;
}
Expand Down

0 comments on commit b21630a

Please sign in to comment.