[Asterisk-cvs] asterisk/channels chan_sip.c,1.267,1.268

jeremy at lists.digium.com jeremy at lists.digium.com
Sun Jan 11 12:58:59 CST 2004


Update of /usr/cvsroot/asterisk/channels
In directory mongoose.digium.com:/tmp/cvs-serv14641

Modified Files:
	chan_sip.c 
Log Message:
check buffer for possible overflow. Thanks Corydon76 Bug #788


Index: chan_sip.c
===================================================================
RCS file: /usr/cvsroot/asterisk/channels/chan_sip.c,v
retrieving revision 1.267
retrieving revision 1.268
diff -u -d -r1.267 -r1.268
--- chan_sip.c	10 Jan 2004 21:19:56 -0000	1.267
+++ chan_sip.c	11 Jan 2004 18:50:46 -0000	1.268
@@ -4114,7 +4114,11 @@
 		y = 0;
 	for (x=0;x<req->lines;x++) {
 		strncat(buf, req->line[x], y);
-		strcat(buf, "\n");
+		y -= strlen(req->line[x]) + 1;
+		if (y < 0)
+			y = 0;
+		if (y != 0)
+			strcat(buf, "\n");
 	}
 	return 0;
 }




More information about the svn-commits mailing list