This week's book giveaway is in the Java 9 forum.
We're giving away four copies of Java 9 Modularity: Patterns and Practices for Developing Maintainable Applications and have Sander Mak & Paul Bakker on-line!
See this thread for details.
Win a copy of Java 9 Modularity: Patterns and Practices for Developing Maintainable Applications this week in the Java 9 forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Can a buffer overflow ever happen in a Java runtime environment?  RSS feed

 
Luke Murphy
Ranch Hand
Posts: 300
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can a buffer overflow ever happen in a Java runtime environment?
If not, why not?
 
Drago Z Kamenov
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I certainly hope not. This is implemented at the JVM level, so we don't know for sure.
 
Teja Saab
Rancher
Posts: 152
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Luke Murphy wrote:Can a buffer overflow ever happen in a Java runtime environment?
If not, why not?


Of course it can and does happen all the time. Java just gives you the ability to know when such a thing happens by throwing an exception so that you can decide if it is something that you want to handle (for eg. ArrayIndexOutOfBoundsException). The JVM security manager prevents unauthorized memory acess though. However, all bets are off if you use native libraries, but then you could make the argument that it is not really running in a JVM.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!