[asterisk-bugs] [JIRA] (ASTERISK-17314) Casting alignment problem in send_client causes bad seq to be generated on ARM platform

niurkin sil (JIRA) noreply at issues.asterisk.org
Wed Dec 4 09:01:04 CST 2013


    [ https://issues.asterisk.org/jira/browse/ASTERISK-17314?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=212484#comment-212484 ] 

niurkin sil commented on ASTERISK-17314:
----------------------------------------

Hello, iḿ using elastix and have the same problem, too many retransmission, but i dont see any chan_unistim.c file. could you please help me.

Thanks
                
> Casting alignment problem in send_client causes bad seq to be generated on ARM platform
> ---------------------------------------------------------------------------------------
>
>                 Key: ASTERISK-17314
>                 URL: https://issues.asterisk.org/jira/browse/ASTERISK-17314
>             Project: Asterisk
>          Issue Type: Bug
>          Components: Channels/chan_unistim
>            Reporter: Jon Joshua
>            Assignee: Igor Goncharovsky
>
> In send_client(), a char array is cast as a short array.  If the char array starts on an odd byte, the short array cast will not be aligned properly and setting the seq into the array will not be the expected result.
> This happens on the ARM platform.
> ****** ADDITIONAL INFORMATION ******
> channels/chan_unistim.c
> send_client()
> If data starts on an odd byte, sdata[1] will point to bytes 2 and 3 of data instead of bytes 3 and 4 as expected:
>         unsigned short *sdata = (unsigned short *) data; 
>         sdata[1] = ntohs(++(pte->seq_server));
> This is one possible solution:
>         unsigned short seq = ntohs(++pte->seq_server);
>         memcpy((void *)data + sizeof(unsigned short), (void *)&seq, sizeof(unsigned short));

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.asterisk.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira



More information about the asterisk-bugs mailing list