[asterisk-commits] igorg: branch 1.8 r339830 - /branches/1.8/channels/chan_unistim.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Sat Oct 8 09:56:39 CDT 2011


Author: igorg
Date: Sat Oct  8 09:56:35 2011
New Revision: 339830

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=339830
Log:

Fix char array cast as short array in send_client() function (for ARM
platform)

(closes issue ASTERISK-17314)
Reported by: jjoshua


Modified:
    branches/1.8/channels/chan_unistim.c

Modified: branches/1.8/channels/chan_unistim.c
URL: http://svnview.digium.com/svn/asterisk/branches/1.8/channels/chan_unistim.c?view=diff&rev=339830&r1=339829&r2=339830
==============================================================================
--- branches/1.8/channels/chan_unistim.c (original)
+++ branches/1.8/channels/chan_unistim.c Sat Oct  8 09:56:35 2011
@@ -802,7 +802,7 @@
 {
 	unsigned int tick;
 	int buf_pos;
-	unsigned short *sdata = (unsigned short *) data;
+	unsigned short seq = ntohs(++pte->seq_server);
 
 	ast_mutex_lock(&pte->lock);
 	buf_pos = pte->last_buf_available;
@@ -812,7 +812,7 @@
 		ast_mutex_unlock(&pte->lock);
 		return;
 	}
-	sdata[1] = ntohs(++(pte->seq_server));
+	memcpy((void *)data + sizeof(unsigned short), (void *)&seq, sizeof(unsigned short));
 	pte->wsabufsend[buf_pos].len = size;
 	memcpy(pte->wsabufsend[buf_pos].buf, data, size);
 




More information about the asterisk-commits mailing list