Summary:ASTERISK-20457: GSM encoding is not thread safe
Reporter:Richard Miller (ulogic)Labels:
Date Opened:2012-09-21 05:04:43Date Closed:2012-10-22 12:32:43
Versions: 10.8.0 11.0.0-beta2 Frequency of
Environment:Attachments:( 0) code.diff
( 1) code.patch
( 2) code.patch
Description:The file codecs/gsm/src/code.c uses a static variable "e" that it is passing down into a lower level function.  The original author in patch level 12 moved it into the gsm_state structure, but that really isn't necessary.  All that needs to be done is to make it a temporary local variable by removing the "static" qualifier.  The bug does not affect decoding, only encoding.
Comments:By: Richard Miller (ulogic) 2012-09-21 05:14:53.723-0500

You can either use the patch I submitted which is simpler, or get the updated source from the author of libgsm at http://www.quut.com/gsm/gsm-1.0.13.tar.gz

By: Richard Miller (ulogic) 2012-09-25 12:20:28.575-0500

There is a slight revision to the patch.  When something is declared static, the storage is initialized to zero by default.  Temporary stack variables have no such initialization, so the e[50] array has to be cleared.

By: Jonathan Rose (jrose) 2012-10-22 12:32:25.915-0500

Thanks for the patch, I just dropped it on the SVN.