--- gaim-0.59.1/src/protocols/oscar/ft.c.foo	2002-03-12 12:21:44.000000000 -0500
+++ gaim-0.59.1/src/protocols/oscar/ft.c	2004-02-04 16:14:41.000000000 -0500
@@ -1101,7 +1101,7 @@
 
 		return ret;
 
-	} else if ((flags == 0x0000) && payloadlength) { 
+	} else if ((flags == 0x0000) && (payloadlength < (UINT_MAX - 1))) { 
 		char *msg, *msg2;
 		int ret = 0;
 		int recvd = 0;
--- gaim-0.59.1/src/proxy.c.foo	2002-08-25 19:26:48.000000000 -0400
+++ gaim-0.59.1/src/proxy.c	2004-02-04 16:14:52.000000000 -0500
@@ -234,7 +234,7 @@
 
 	gaim_input_remove(phb->inpa);
 
-	while ((nlc != 2) && (read(source, &inputline[pos++], 1) == 1)) {
+        while ((pos < sizeof(inputline)-1) && (nlc != 2) && (read(source, &inputline[pos++], 1) == 1)) {
 		if (inputline[pos - 1] == '\n')
 			nlc++;
 		else if (inputline[pos - 1] != '\r')
