[eggheads-patches] PATCH: net.c.patch

Dobos Lorant drummer at sophia.btk.pte.hu
Sat Oct 28 16:39:01 CST 2000


net.c sun_firewall bufferoverflow fix

-------------- next part --------------
? net.c.patch
Index: src/net.c
===================================================================
RCS file: /usr/local/cvsroot/eggdrop-devel/src/net.c,v
retrieving revision 1.25
diff -u -r1.25 net.c
--- src/net.c	2000/10/27 19:35:51	1.25
+++ src/net.c	2000/10/28 17:10:28
@@ -312,7 +312,7 @@
 {
   unsigned char x[10];
   struct hostent *hp;
-  char s[30];
+  char s[256];
   int i;
 
   /* socks proxy */
@@ -344,7 +344,8 @@
 	    x[0], x[1], x[2], x[3], botuser);
     tputs(sock, s, strlen(botuser) + 9); /* drummer */
   } else if (proxy == PROXY_SUN) {
-    sprintf(s, "%s %d\n", host, port);
+    snprintf(s, 255, "%s %d\n", host, port);
+    s[255] = 0;
     tputs(sock, s, strlen(s)); /* drummer */
   }
   return sock;


More information about the Patches mailing list