[Asterisk-cvs] asterisk channel.c,1.209,1.210

kpfleming at lists.digium.com kpfleming at lists.digium.com
Tue Jul 5 15:43:53 CDT 2005


Update of /usr/cvsroot/asterisk
In directory localhost.localdomain:/tmp/cvs-serv891

Modified Files:
	channel.c 
Log Message:
ensure that text frames are copied correctly even if they are not null-terminated (bug #4615)


Index: channel.c
===================================================================
RCS file: /usr/cvsroot/asterisk/channel.c,v
retrieving revision 1.209
retrieving revision 1.210
diff -u -d -r1.209 -r1.210
--- channel.c	5 Jul 2005 17:16:16 -0000	1.209
+++ channel.c	5 Jul 2005 19:52:48 -0000	1.210
@@ -1716,7 +1716,7 @@
 		if (f->frametype == AST_FRAME_CONTROL && f->subclass == AST_CONTROL_HANGUP)
 			done = 1;	/* force a break */
 		else if (f->frametype == AST_FRAME_TEXT) {	/* what we want */
-			buf = strdup((char *)f->data);	/* dup and break */
+			buf = strndup((char *)f->data, f->datalen);	/* dup and break */
 			done = 1;
 		}
 		ast_frfree(f);




More information about the svn-commits mailing list