Why buffer overflow doesn't affect to this code?

前端 未结 5 2023
傲寒
傲寒 2021-01-26 15:09

I have the following code:

int main(int argc, char *argv[])
{
    char ch[10];
    printf(\"String 10 max. :: \"); gets( ch );

    printf(\"String: %s\\n\", ch)         


        
5条回答
  •  自闭症患者
    2021-01-26 15:13

    The effect of a buffer overrun depends entirely what you overwrite, what you overwrite it with, and how the overwritten data is subsequently used.

    The method of buffer overrun exploitation involves using the overrun to modify the return address of a function; but returning from main() to the OS may not be quite the same as returning from a function.

提交回复
热议问题