Author: igorg
Date: Thu Oct 30 01:15:14 2014
New Revision: 426669

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=426669
Log:

Add additional checks for NULL pointers to fix several crashes reported.

ASTERISK-24304 #close
Reported by: dhanapathy sathya
........

Merged revisions 426666 from http://svn.asterisk.org/svn/asterisk/branches/11
........

Merged revisions 426667 from http://svn.asterisk.org/svn/asterisk/branches/12
........

Merged revisions 426668 from http://svn.asterisk.org/svn/asterisk/branches/13

Modified:
    trunk/   (props changed)
    trunk/channels/chan_unistim.c

Propchange: trunk/
------------------------------------------------------------------------------
Binary property 'branch-13-merged' - no diff available.

Modified: trunk/channels/chan_unistim.c
URL: 
http://svnview.digium.com/svn/asterisk/trunk/channels/chan_unistim.c?view=diff&rev=426669&r1=426668&r2=426669
==============================================================================
--- trunk/channels/chan_unistim.c (original)
+++ trunk/channels/chan_unistim.c Thu Oct 30 01:15:14 2014
@@ -2634,6 +2634,9 @@
        struct unistimsession *s = l->parent->session;
        int res;
 
+       if (!s) {
+               return NULL;
+       }
        ast_verb(3, "Starting switch on '%s@%s-%d' to %s\n", l->name, 
l->parent->name, sub->softkey, s->device->phone_number);
        ast_channel_lock(chan);
        ast_channel_exten_set(chan, s->device->phone_number);
@@ -3404,6 +3407,9 @@
        struct unistim_subchannel *sub = get_sub(pte->device, SUB_REAL);
        struct unistim_subchannel *sub_3way = get_sub(pte->device, 
SUB_THREEWAY);
 
+       if (!sub) {
+               return;
+       }
        if ((keycode >= KEY_0) && (keycode <= KEY_SHARP)) {
                if (keycode == KEY_SHARP) {
                        keycode = '#';
@@ -3417,7 +3423,7 @@
        }
        switch (keycode) {
        case KEY_FUNC1:
-               if (ast_channel_state(sub->owner) == AST_STATE_UP) {
+               if (sub->owner && ast_channel_state(sub->owner) == 
AST_STATE_UP) {
                        if (sub_3way) {
                                close_call(pte);
                        }


-- 
_____________________________________________________________________
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

svn-commits mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/svn-commits

Reply via email to