[asterisk-dev] file: branch 1.2 r47711 - /branches/1.2/channels/chan_local.c

Nic Bellamy nicb-lists at vadacom.co.nz
Thu Nov 16 16:31:37 MST 2006


Martin Vít wrote:

> There should be the same fix for chan_sip.c in sip_fixup. I've random 
> crashes (not often) with version 1.2.7.1.

A quick look shows chan->tech_pvt being used without checking if it's 
null by other channel drivers too; chan_zap.c's zt_fixup() for instance. 
Would it be a good idea to check it and bail out if it's null in those 
places also?

Asking as I'm not entirely sure under which curcumstances it can get to 
fixup with a null tech_pvt...

Cheers,
    Nic.

> svn-commits at lists.digium.com wrote:
>
>> Author: file
>> Date: Wed Nov 15 16:29:30 2006
>> New Revision: 47711
>>
>> URL: http://svn.digium.com/view/asterisk?view=rev&rev=47711
>> Log:
>> Make sure that the pvt structure exists before trying to do fixup on 
>> Local channels. (issue #7937 reported by mada123, fix by alamantia 
>> with mods by me)
>>
>> Modified:
>>     branches/1.2/channels/chan_local.c
>>
>> Modified: branches/1.2/channels/chan_local.c
>> URL: 
>> http://svn.digium.com/view/asterisk/branches/1.2/channels/chan_local.c?view=diff&rev=47711&r1=47710&r2=47711 
>>
>> ============================================================================== 
>>
>> --- branches/1.2/channels/chan_local.c (original)
>> +++ branches/1.2/channels/chan_local.c Wed Nov 15 16:29:30 2006
>> @@ -263,6 +263,10 @@
>>  static int local_fixup(struct ast_channel *oldchan, struct 
>> ast_channel *newchan)
>>  {
>>      struct local_pvt *p = newchan->tech_pvt;
>> +
>> +    if (!p)
>> +        return -1;
>> +
>>      ast_mutex_lock(&p->lock);
>>  
>>      if ((p->owner != oldchan) && (p->chan != oldchan)) {
>>
>> _______________________________________________
>> --Bandwidth and Colocation provided by Easynews.com --
>>
>> svn-commits mailing list
>> To UNSUBSCRIBE or update options visit:
>>    http://lists.digium.com/mailman/listinfo/svn-commits
>>
>>   
>
>
>


-- 
Nic Bellamy,
Head Of Engineering, Vadacom Ltd - http://www.vadacom.co.nz/



More information about the asterisk-dev mailing list