Index: channels/chan_skinny.c =================================================================== --- channels/chan_skinny.c (revision 57915) +++ channels/chan_skinny.c (working copy) @@ -1425,6 +1425,11 @@ if (skinnydebug) ast_log(LOG_VERBOSE, "writing packet type %04X (%d bytes) to socket %d\n", letohl(req->e), letohl(req->len)+8, s->fd); + if (!s) { + ast_log(LOG_WARNING, "transmit_response: no session\n"); + return -1; + } + if (letohl(req->len > SKINNY_MAX_PACKET) || letohl(req->len < 0)) { ast_log(LOG_WARNING, "transmit_response: the length of the request is out of bounds\n"); return -1;