[sr-dev] git:pd/websocket: core: Fixed segmentation fault

Peter Dunkley peter.dunkley at crocodile-rcs.com
Sat Jun 30 21:36:39 CEST 2012


Module: sip-router
Branch: pd/websocket
Commit: 6fe3e10b4a17c166f642500748392a9bcb72cabd
URL:    http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=6fe3e10b4a17c166f642500748392a9bcb72cabd

Author: Peter Dunkley <peter.dunkley at crocodile-rcs.com>
Committer: Peter Dunkley <peter.dunkley at crocodile-rcs.com>
Date:   Sat Jun 30 20:35:10 2012 +0100

core: Fixed segmentation fault

- Tiny window for this...  but I hit it when Google Chrome crashed during
  a WebSocket session

---

 forward.h |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/forward.h b/forward.h
index 02cfd12..2b9ae78 100644
--- a/forward.h
+++ b/forward.h
@@ -164,6 +164,12 @@ static inline int msg_send(struct dest_info* dst, char* buf, int len)
 			return -1;
 		}
 
+		if (con == NULL)
+		{
+			LM_WARN("TCP/TLS connection for WebSocket could not be found\n");
+			return -1;
+		}
+
 		memset(&wsev, 0, sizeof(ws_event_info_t));
 		wsev.type = SREV_TCP_WS_FRAME_OUT;
 		wsev.buf = outb.s;




More information about the sr-dev mailing list