Java中的缓冲区溢出是什么样子的?

huangapple go评论73阅读模式
英文:

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.

huangapple
  • 本文由 发表于 2020年8月5日 12:52:22
  • 转载请务必保留本文链接:https://go.coder-hub.com/63258625.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定