Assertion failed! esp32
Posted: Wed Nov 15, 2023 1:31 pm
Hi, I'm learing to check how bufferoverflow happen what kind of mistake the developers do. and for that my supervisor told me to write the code and he helped me. As we know first we have to perform windowoverflow and then bufferoverflow. and for that i worte below code:
error::
Note::
Addresses are calculated correctly.
- #include <stdio.h>
- #include <stdbool.h>
- #include <unistd.h>
- #include <string.h>
- void function_A(){
- asm("");
- }
- void function_B(){
- function_A();
- }
- char myNumbers[] = {1, 2, 3, 4,5, 6, 7, 8,9, 10, 11, 12,13, 14, 15, 16,17, 18, 19, 20,21, 22, 23, 24,25, 26, 27, 28,29, 30, 31, 32,33, 34, 35, 36,
- 1, 2, 3, 4,5, 6, 7, 8,9, 10, 11, 12,13, 14, 15, 16,17, 18, 19, 20,21, 22, 23, 24,25, 26, 27, 28,29, 30, 31, 32,33, 34, 35, 36,
- 1, 2, 3, 4,5, 6, 7, 8,9, 10, 11, 12,13, 14, 15, 16,17, 18, 19, 20,21, 22, 23, 24,25, 26, 27, 28,29, 30, 31, 32,33, 34, 35, 36,
- };
- void function_C(){
- function_B();
- char small_array[] = {'a','b','c','d'};
- strcpy(small_array, myNumbers);
- }
- void function_D(){
- function_C();
- }
- void app_main(void)
- {
- function_D();
- }
error::
Assertion failed!
Program: C:\Espressif\tools\openocd-esp32\v0.11.0-esp32-20221026\openocd-esp32\bin\openocd.exe
File: ../src/flash/nor/esp_flash.c, Line 1129
Expression: sw_bp->insn_sz <= sizeof(sw_bp->insn)
Note::
Addresses are calculated correctly.