Re: Java and buffer overflows

From: ash (ashcrow@phreaker.net)
Date: 06/26/02


From: ash <ashcrow@phreaker.net>
To: KF <dotslash@snosoft.com>
Date: 26 Jun 2002 14:05:49 -0400

What happened here is that the JavaVM caught an exception while parsing
the code. It won't cause any problems AFAIK but it will keep a program
from working ;-).

Generally speaking you use try {} catch () {} to deal with raised
exceptions in Java so that if an error does happen it is delt with
properly or errors out in such a manor that the user can understand why.

Cheers,
Ash

----
Darkfire Secure Linux -- http://www.gnulinux.net

On Mon, 2002-06-24 at 23:40, KF wrote: > Not sure if this helps .... I was trying to come up with a scenario that > passed user input to a buffer but the compiler kept barking at me so > this is the best I can do. > > [root@qa5 root]# cat test.java > class test > { > public static void main(String args[]) > { > > String[] test = new String[4]; > test[0] = "A"; > test[1] = "A"; > test[2] = "A"; > test[3] = "A"; > test[4] = "A"; > test[5] = "A"; > test[6] = "A"; > } > } > > > [root@rcmqa5 root]# javac test.java > [root@rcmqa5 root]# java test > Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 4 > at test.main(test.java:11) > > -KF



Relevant Pages

  • Re: Setting timeout for methods
    ... > it will be polled and after that it will throw an exception. ... > Here say for example GetString in class test is a method for which i ... > want to provide timeout. ... > public string GetString(int count, ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Tomcat - Internal Server Error 500
    ... The root cause is NoClassDefFoundError (shown ... internal error 500. ... error, upon pressing submit. ... It shows the following exception: ...
    (comp.lang.java.help)
  • Re: "False exceptions?" (was Re: theme of the week: tools
    ... a debugger can be useless because it affects the scheduling ... My point was that even just this particular exception ... Even if there is an exception, the root problem may be way ... from prior memory corruption) quickly end up in some state where you ...
    (comp.lang.python)
  • Re: (Linux) GNAT socket exception - when setting No_Delay
    ... You didn't say what exception you're getting. ... the TCP/IP stack. ... errno, then GNAT.Ada immediately raises the Socket_Error exception. ... and you are not root. ...
    (comp.lang.ada)
  • RE: CDO problems with synchronous store event sink
    ... registered the handler for sync events at the root of my mailbox. ... Stream Open throws an exception with code 0x800a0cb3, ...
    (microsoft.public.exchange2000.applications)