英文:
What does a buffer overflow in Java look like?
问题
在其他编程语言中,我见过 buffer overflows
,但在Java中是什么样的?
英文:
I have seen buffer overflows
in other programming languages, but how does it look in Java?
答案1
得分: 0
上面的答案解释了为什么在Java中触发缓冲区溢出通常不常见。如果出现缓冲区溢出,错误通常不在您的代码中,除非您使用本机接口。
我猜测(这里只是猜测),这取决于本机接口可能出现的异常是什么样子,或者是否根本处理了异常,或者JVM是否只会因为系统级异常而崩溃。
英文:
https://stackoverflow.com/questions/479701/does-java-have-buffer-overflows
The above answer explains why it is not common in java to actually trigger a buffer overflow. If you get one, the error is usually not in your code, unless you program with a native interface.
I guess (speculation here) that it then depends on the native interface what a possible exception might look like, or wether the exception is handled at all, or the JVM will just crash with a system level exception.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论