Opened 5 years ago

Closed 3 years ago

#1480 closed defect (fixed)

UPnP: IllegalArgumentException while parsing SSDPPacket

Reported by: str4d Owned by: zzz
Priority: minor Milestone: 0.9.28
Component: router/transport Version: 0.9.17
Keywords: UPnP Cc:
Parent Tickets: Sensitive: no

Description

From Google Play:

java.lang.IllegalArgumentException: size <= 0
    at java.io.BufferedReader.<init>(BufferedReader.java:109)
    at java.io.LineNumberReader.<init>(LineNumberReader.java:59)
    at org.cybergarage.http.HTTPHeader.getValue(HTTPHeader.java:121)
    at org.cybergarage.http.HTTPHeader.getValue(HTTPHeader.java:127)
    at org.cybergarage.upnp.ssdp.SSDPPacket.getHost(SSDPPacket.java:132)
    at org.cybergarage.upnp.ssdp.SSDPPacket.getHostInetAddress(SSDPPacket.java:187)
    at org.cybergarage.upnp.ssdp.SSDPNotifySocket.run(SSDPNotifySocket.java:132)
    at java.lang.Thread.run(Thread.java:818)

Reports total: 1
Application version: 0.9.17.1
Android version: 5.0
Device: Nexus 5 (hammerhead)

Subtickets

Change History (4)

comment:1 Changed 5 years ago by zzz

Constructor IAE not documented but clearly wrong and super (BufferedReader?) does document IAE.

There's nothing to catch an IAE or other unchecked exception in the socket thread.

We can add code to catch it but should probably update the upnp lib first, then report upstream if we don't see a fix. Killing the whole thread is bad as this will kill any SSDP reception. But obviously rare… it's some bad SSDP packet, or an empty packet? No, looks like a bogus or missing HTTP Host: header? See SSDPPacket.getHostInetAddress()

comment:2 Changed 5 years ago by zzz

UPnP lib updated to latest in 0.9.18-6. Very unlikely to fix this. We should proceed with a local fix.

comment:3 Changed 4 years ago by str4d

Status: newopen

comment:4 Changed 3 years ago by zzz

Milestone: undecided0.9.28
Resolution: fixed
Status: openclosed
Note: See TracTickets for help on using tickets.