Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

#38 ControlPoint.getDevice() crashes index out of range

open
nobody
5
2012-01-10
2012-01-10
Larry Hamel
No

Running on Android 3.1 (Google TV), java 1.6. This stack was de-obfuscated--sorry for the crufty appearance.

[java] SEVERE: uncaught:
[java] Throwable occurred: java.lang.ArrayIndexOutOfBoundsException: index=3, size=3
[java] at java.util.Vector.arrayIndexOutOfBoundsException(Vector.java:907)
[java] at java.util.Vector.elementAt(Vector.java:328)
[java] at java.util.Vector.get(Vector.java:442)
[java] at org.cybergarage.xml.NodeList.getNode(SourceFile:28)
[java] at org.cybergarage.upnp.ControlPoint.getDevice(SourceFile:307)
[java] at org.cybergarage.upnp.ControlPoint.notifyReceived(SourceFile:509)
[java] at org.cybergarage.upnp.ssdp.SSDPNotifySocket.run(SourceFile:138)
[java] at java.lang.Thread.run(Thread.java:1020)
[java]
[java]

Discussion

  • Larry Hamel
    Larry Hamel
    2012-01-11

    protected this call with:

    $ svn diff ControlPoint.java
    Index: ControlPoint.java
    ===================================================================
    --- ControlPoint.java (revision 174)
    +++ ControlPoint.java (working copy)
    @@ -304,7 +304,13 @@
    {
    int nRoots = devNodeList.size();
    for (int n=0; n<nRoots; n++) {
    - Node rootNode = devNodeList.getNode(n);
    + Node rootNode;
    + try {
    + rootNode = devNodeList.getNode(n);
    + } catch (Throwable t ) {
    + System.out.println("problem getting node for name: " + name + " err: " + t);
    + continue;
    + }
    Device dev = getDevice(rootNode);
    if (dev == null)
    continue;

     
  • Larry Hamel
    Larry Hamel
    2012-01-11

     
    Attachments