Ver código fonte

* Fixed some bugs that valgrind found (mainly overlapping strcpys)

svn: 497
Bryan Drewery 22 anos atrás
pai
commit
fc3ab45fde
2 arquivos alterados com 4 adições e 2 exclusões
  1. 2 1
      src/main.c
  2. 2 1
      src/userrec.c

+ 2 - 1
src/main.c

@@ -1923,7 +1923,8 @@ Context;
 
     /* Free unused structures. */
     garbage_collect();
-
+    
+    buf[0] = 0;
     xx = sockgets(buf, &i); 
     if (xx >= 0) {		/* Non-error */
       int idx;

+ 2 - 1
src/userrec.c

@@ -175,7 +175,8 @@ char *fixfrom(char *s)
 				 * user@host here... */
   /* These are ludicrous. */
   if (strchr("~+-^=", *p) && (p[1] != '@')) /* added check for @ - drummer */
-    strcpy(p, p + 1);
+//    strcpy(p, p + 1);
+    sprintf(p, "%s", p + 1);
   /* Bug was: n!~@host -> n!@host  now: n!~@host */
   return buf;
 }