Opened 9 years ago

Closed 7 years ago

#809 closed defect (fixed)

NPE in POP3MailBox

Reported by: Zlatin Balevsky Owned by: Zlatin Balevsky
Priority: minor Milestone: 0.9.13
Component: apps/susimail Version: 0.9.3
Keywords: susi npe Cc: Zlatin Balevsky
Parent Tickets: Sensitive: no


While checking email with Susi:

	at i2p.susi.webmail.pop3.POP3MailBox.sendCmd1a(
	at i2p.susi.webmail.pop3.POP3MailBox.sendCmdNa(
	at i2p.susi.webmail.pop3.POP3MailBox.sendCmdN(
	at i2p.susi.webmail.pop3.POP3MailBox.sendCmdN(
	at i2p.susi.webmail.pop3.POP3MailBox.getHeader(
	at i2p.susi.webmail.pop3.POP3MailBox.getHeader(
	at i2p.susi.webmail.MailCache.getMail(
	at i2p.susi.webmail.WebMail.processRequest(
	at i2p.susi.webmail.WebMail.doPost(
	at javax.servlet.http.HttpServlet.service(
	at javax.servlet.http.HttpServlet.service(
	at org.mortbay.jetty.servlet.ServletHolder.handle(
	at org.mortbay.jetty.servlet.ServletHandler.handle(
	at org.mortbay.jetty.servlet.SessionHandler.handle(
	at org.mortbay.jetty.handler.ContextHandler.handle(
	at org.mortbay.jetty.webapp.WebAppContext.handle(
	at org.mortbay.jetty.handler.ContextHandlerCollection.handle(
	at org.mortbay.jetty.handler.HandlerCollection.handle(
	at org.mortbay.jetty.handler.HandlerWrapper.handle(
	at org.mortbay.jetty.Server.handle(
	at org.mortbay.jetty.HttpConnection.handleRequest(
	at org.mortbay.jetty.HttpConnection$RequestHandler.content(
	at org.mortbay.jetty.HttpParser.parseNext(
	at org.mortbay.jetty.HttpParser.parseAvailable(
	at org.mortbay.jetty.HttpConnection.handle(
	at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(
	at java.util.concurrent.ThreadPoolExecutor$


Change History (3)

comment:1 Changed 8 years ago by str4d

The line in question is:


The line before is cmd += "\r\n";, meaning that cmd is not null. So either the socket was null or socket.getOutputStream() returned null.

comment:2 Changed 7 years ago by zzz

getOutputStream() throws IOE, it will not return null. So socket is null.

sendCmdN() checks for isConnected() but not socket == null.

sendCmdNa() doesn't check for socket == null either before calling sendCmd1a().

Some of the other calls to sendCmd1a() in the file check for socket == null first, but some don't.

Seems like a messy interrelation of isConnected() and socket == null and the synchronization. Not clear how to untangle it.

comment:3 Changed 7 years ago by zzz

Milestone: 0.9.13
Resolution: fixed
Status: newclosed

I'm going to optimistically declare this fixed in the big rewrite in the 0.9.12-x cycle. Lots of synchronization added to POP3MailBox.

Note: See TracTickets for help on using tickets.