[asterisk-bugs] [JIRA] (ASTERISK-27558) [patch] codec_gsm: Avoid shifting a negative signed value.
Asterisk Team (JIRA)
noreply at issues.asterisk.org
Sat Jan 6 04:52:39 CST 2018
[ https://issues.asterisk.org/jira/browse/ASTERISK-27558?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=241381#comment-241381 ]
Asterisk Team commented on ASTERISK-27558:
------------------------------------------
Thanks for creating a report! The issue has entered the triage process. That means the issue will wait in this status until a Bug Marshal has an opportunity to review the issue. Once the issue has been reviewed you will receive comments regarding the next steps towards resolution.
A good first step is for you to review the [Asterisk Issue Guidelines|https://wiki.asterisk.org/wiki/display/AST/Asterisk+Issue+Guidelines] if you haven't already. The guidelines detail what is expected from an Asterisk issue report.
Then, if you are submitting a patch, please review the [Patch Contribution Process|https://wiki.asterisk.org/wiki/display/AST/Patch+Contribution+Process].
> [patch] codec_gsm: Avoid shifting a negative signed value.
> ----------------------------------------------------------
>
> Key: ASTERISK-27558
> URL: https://issues.asterisk.org/jira/browse/ASTERISK-27558
> Project: Asterisk
> Issue Type: Bug
> Security Level: None
> Components: Codecs/codec_gsm
> Affects Versions: 13.18.5, 15.1.5
> Reporter: Alexander Traud
> Severity: Minor
> Labels: patch
> Attachments: libgsm_left_shift_unsigned.patch
>
>
> The compiler _clang_ (5.0.1) reports:{code}src/short_term.c:67:2: warning: shifting a negative signed value is undefined [-Wshift-negative-value]
> STEP( -2560, -16, 13107 );
> ^ ~~~~~
> src/short_term.c:70:2: warning: shifting a negative signed value is undefined [-Wshift-negative-value]
> STEP( -1792, -8, 17476 );
> ^ ~~~~~
> src/short_term.c:71:2: warning: shifting a negative signed value is undefined [-Wshift-negative-value]
> STEP( -341, -4, 31454 );
> ^ ~~~~
> src/short_term.c:72:2: warning: shifting a negative signed value is undefined [-Wshift-negative-value]
> STEP( -1144, -4, 29708 );
> ^ ~~~~~
> src/short_term.c:60:32: note: expanded from macro 'STEP'
> temp1 = GSM_SUB( temp1, B << 1 ); \
> ~ ^{code}This is an external library, which is still maintained by its original author [Jutta Degener|http://twitter.com/juttadegener]: http://www.quut.com/gsm/
> The latest upstream change happened in 2017 and that version is called '1.0 Patchlevel 17' aka 1.0.17. The copy within Asterisk is '1.0 Patchlevel 10' aka 1.0.9 from 1996. Debian 9, Ubuntu 18.04 LTS, FreeBSD 11.1, and CentOS 7.4 have 1.0.13 (from 2009). OpenBSD 6.2 has the current version.
> Therefore, the *short*-term workaround is to use the precompiled libgsm of your Unix distribution, for example in Debian/Ubuntu: {{sudo apt install libgsm1-dev}}. As *mid*-term solution, I created/attached the difference between 1.0.10 and 1.0.17 for the file {{src/codec.c}}, which resolves the clang issue above. As *long*-term approach within Asterisk, that external library should be
> A) updated to the latest upstream version. Or
> B) removed and relied solely on precompiled Unix packages.
--
This message was sent by Atlassian JIRA
(v6.2#6252)
More information about the asterisk-bugs
mailing list