[mw-devel] MW3 r956 - trunk/src

psycodom at sucs.org psycodom at sucs.org
Sat Apr 28 21:41:37 BST 2007


Author: psycodom
Date: 2007-04-28 21:41:37 +0100 (Sat, 28 Apr 2007)
New Revision: 956

Modified:
   trunk/src/ipc.c
Log:
Fixes a buffer overflow in ipc_send_to_pid which could cause too much data to be written to the pipes..


Modified: trunk/src/ipc.c
===================================================================
--- trunk/src/ipc.c	2007-04-26 13:58:18 UTC (rev 955)
+++ trunk/src/ipc.c	2007-04-28 20:41:37 UTC (rev 956)
@@ -43,11 +43,11 @@
 	if (msgtype != IPC_NOOP) {
 		memset(buff, 0, MAXTEXTLENGTH);
 		qdata = quotetext(data);
-		dgram_len = snprintf(buff, MAXTEXTLENGTH - 1, "%cxxxx%s",(char) msgtype, qdata);
+		snprintf(buff, MAXTEXTLENGTH - 1, "%cxxxx%s",(char) msgtype, qdata);
 		free(qdata);
 		strip_quote(buff);
 		strcat(buff,"|");
-		dgram_len++;
+		dgram_len = strlen(buff);
 		mypid = getpid();
 		memcpy(buff + 1, &mypid, 4);
 		if (write(fd, buff, dgram_len) <= 0) {





More information about the mw-devel mailing list