People say buffer overflows are serious security bugs that can usually be exploited. Here is an artificial buffer overflow
#include <stdio.h>
int main(){
int a[3]={0,1,2};
printf("value = %d\n",a[10]);
}
I have two basic questions:
- Does "exploit the buffer overflow" mean to change the code? If so, how to change the code above to make an attack?
- What if the code is read-only? Can attackers still do something?