From 188828841155dc664701966d77a5d02eee712dea Mon Sep 17 00:00:00 2001 From: Jakub Adam Date: Wed, 6 Jul 2011 23:13:35 +0200 Subject: [PATCH] conf: fix possible segfault in sipe_conf_cancel_unaccepted() Possible NULL dereference of ctx->msg. --- src/core/sipe-conf.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/core/sipe-conf.c b/src/core/sipe-conf.c index 9b688663..7478d404 100644 --- a/src/core/sipe-conf.c +++ b/src/core/sipe-conf.c @@ -797,13 +797,17 @@ sipe_conf_cancel_unaccepted(struct sipe_core_private *sipe_private, GSList *it = sipe_private->sessions_to_accept; while (it) { struct conf_accept_ctx *ctx = it->data; - const gchar *callid2 = msg ? sipmsg_find_header(ctx->msg, "Call-ID") : NULL; + const gchar *callid2 = NULL; + + if (msg && ctx->msg) + callid2 = sipmsg_find_header(ctx->msg, "Call-ID"); if (sipe_strequal(callid1, callid2)) { GSList *tmp; - sip_transport_response(sipe_private, ctx->msg, - 487, "Request Terminated", NULL); + if (ctx->msg) + sip_transport_response(sipe_private, ctx->msg, + 487, "Request Terminated", NULL); if (msg) sip_transport_response(sipe_private, msg, 200, "OK", NULL); -- 2.11.4.GIT