Opened 3 years ago

Closed 3 years ago

#1821 closed defect (fixed)

NPE in streaming ConnectionHandler

Reported by: str4d Owned by:
Priority: minor Milestone: 0.9.27
Component: streaming Version: 0.9.26
Keywords: Cc:
Parent Tickets:


ConnectionHandler.sendReset(packet) throws the following NPE when debug logging is enabled:

WARN [te #10167]: ] reaming.impl.ConnectionHandler: Dropping new SYN request, as we're not listening
ERROR [te #10167]: ] lient.impl.I2PSessionMuxedImpl: Error notifying app of message availability
     at net.i2p.client.streaming.impl.Packet.toFlagString(
     at net.i2p.client.streaming.impl.Packet.formatAsString(
     at net.i2p.client.streaming.impl.PacketLocal.formatAsString(
     at net.i2p.client.streaming.impl.Packet.toString(
     at java.lang.String.valueOf(
     at java.lang.StringBuilder.append(
     at net.i2p.client.streaming.impl.ConnectionHandler.sendReset(
     at net.i2p.client.streaming.impl.ConnectionHandler.receiveNewSyn(
     at net.i2p.client.streaming.impl.PacketHandler.receiveUnknownCon(
     at net.i2p.client.streaming.impl.PacketHandler.receivePacketDirect(
     at net.i2p.client.streaming.impl.PacketHandler.receivePacket(
     at net.i2p.client.streaming.impl.MessageHandler.messageAvailable(
     at net.i2p.client.impl.I2PSessionDemultiplexer.messageAvailable(
     at net.i2p.client.impl.I2PSessionMuxedImpl$

Steps to recreate:

  1. Set net.i2p.client.streaming.impl.ConnectionHandler=DEBUG in logging config.
  2. Wait for ConnectionHandler.sendReset() to be called.

I believe it is caused by sendReset() calling reply.setFlag(Packet.FLAG_SIGNATURE_INCLUDED) instead of reply.setOptionalSignature(sig).


Change History (1)

comment:1 Changed 3 years ago by zzz

  • Milestone changed from undecided to 0.9.27
  • Resolution set to fixed
  • Status changed from new to closed

Fixed in c62904685f0153a5b8cd032e8b3f1c4f64c5bec9 0.9.26-8 untested

The sig will be set later on, the flag tells it to be signed. The fix just handles that case in the toFlagString() code.

Note: See TracTickets for help on using tickets.