C++ 中的堆栈损坏堆栈

由网友(迩比柠檬更萌⌒_⌒)分享简介:在 C++ 中,堆栈可能会被破坏.我猜的一种方法是通过访问超出其边界的数组来覆盖堆栈变量.有没有其他方法可以损坏它?In C++, in which way the stack may get corrupted. One way I guess is to overwriting the stack variabl...

在 C++ 中,堆栈可能会被破坏.我猜的一种方法是通过访问超出其边界的数组来覆盖堆栈变量.有没有其他方法可以损坏它?

In C++, in which way the stack may get corrupted. One way I guess is to overwriting the stack variables by accessing an array beyond its boundaries. Is there any other way that it can get corrupted?

推荐答案

你可以有一个随机/未定义的指针,最终指向堆栈,然后写.汇编函数可能会错误地设置/修改/恢复堆栈宇宙波可以翻转堆栈中的位.芯片外壳中的放射性元素可能会翻转位.内核中的任何内容都可能出错并意外更改您的堆栈内存.

但这些并不是 C++ 特有的,它不知道堆栈.

But those are not particular to C++, which doesn't have any idea of the stack.

阅读全文

相关推荐

最新文章