[asterisk-users] More issues with Siren14 datalen == 0 packets

Joshua Colp jcolp at digium.com
Wed Apr 12 08:01:50 CDT 2017


On Wed, Apr 12, 2017, at 09:50 AM, Richard Kenner wrote:
> Another crash with a packet:
> 
> $10 = {frametype = AST_FRAME_VOICE, subclass = {integer = 0, 
>     format = 0x12c62170, frame_ending = 0}, datalen = 0, samples = 640, 
>   mallocd = 1, mallocd_hdr_len = 324, offset = 64, 
>   src = 0x2ad290064a08 "siren14tolin32/speex", data = {ptr = 0x80893318, 
>     uint32 = 2156475160, pad = "\030\063\211\200\000\000\000"}, delivery
>     = {
>     tv_sec = 1492000520, tv_usec = 225198}, frame_list = {next = 0x0}, 
>   flags = 0, ts = 0, len = 0, seqno = 0}
> 
> Note that datalen is zero, but samples aren't.
> 
> main/slinfactory.c near line 177 doesn't check for datalen of zero,
> but copies using samples.
> 
> Fixed thusly:

<snip>

All patches need to go into JIRA with a license agreement to be
accepted.

> 
> How many more of these cases are there going to be?

It's not a common thing that codecs use, so older code may not handle
it.
 
> Why is samples being used as a length instead of datalen?

Internally a signed linear factory operates in terms of samples, not the
data payload itself. I've also commented on your original issue in
regards to the siren codecs that it should NULL out the data pointer
itself. That is more commonly used.

-- 
Joshua Colp
Digium, Inc. | Senior Software Developer
445 Jan Davis Drive NW - Huntsville, AL 35806 - US
Check us out at: www.digium.com & www.asterisk.org



More information about the asterisk-users mailing list