From dab9c2df0b1372a906be91711cc7f46c0a147f9e Mon Sep 17 00:00:00 2001 From: Tristan Matthews <tristan.matthews@savoirfairelinux.com> Date: Fri, 2 Mar 2012 17:40:37 -0500 Subject: [PATCH] sipaccount: avoid segfault if sipaccount is NULL --- daemon/src/sip/sipaccount.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/daemon/src/sip/sipaccount.cpp b/daemon/src/sip/sipaccount.cpp index b6ac6eb7dc..cb4123cc61 100644 --- a/daemon/src/sip/sipaccount.cpp +++ b/daemon/src/sip/sipaccount.cpp @@ -834,10 +834,12 @@ std::string SIPAccount::getContactHeader() const void SIPAccount::keepAliveRegistrationCb(UNUSED pj_timer_heap_t *th, pj_timer_entry *te) { - SIPAccount *sipAccount = reinterpret_cast<SIPAccount *>(te->user_data); + SIPAccount *sipAccount = static_cast<SIPAccount *>(te->user_data); - if (sipAccount == NULL) + if (sipAccount == NULL) { ERROR("Sip account is NULL while registering a new keep alive timer"); + return; + } // IP2IP default does not require keep-alive if (sipAccount->getAccountID() == IP2IP_PROFILE) -- GitLab