]> code.citadel.org Git - citadel.git/commitdiff
messages.c: don't auto-link URL's in messages if it would cause
authorArt Cancro <ajc@citadel.org>
Tue, 13 Jul 1999 03:48:56 +0000 (03:48 +0000)
committerArt Cancro <ajc@citadel.org>
Tue, 13 Jul 1999 03:48:56 +0000 (03:48 +0000)
          a buffer overrun.

webcit/ChangeLog
webcit/messages.c

index 7b6ac85c34bda3791fbbc08a40e913dec5c02a18..885017a19ce33433dfaefcf501d1abb01d67a956 100644 (file)
@@ -1,6 +1,8 @@
 Mon Jul 12 23:30:24 EDT 1999 Art Cancro <ajc@uncnsrd.mt-kisco.ny.us> 
        * webcit.c: exit Webcit sessions semi-gracefully when the connection
          to a Citadel server fails.
+       * messages.c: don't auto-link URL's in messages if it would cause
+         a buffer overrun.
 
 Sat Jul 10 17:51:39 EDT 1999 Art Cancro <ajc@uncnsrd.mt-kisco.ny.us>
        * Recompiled the Java chat applet using a genuine JDK 1.0.2
index 2c398b8e0cb71c9d88fc2da6ce2184ac0107402c..0b8aabaadd213def6366fa5f5c7ef9c538c14c17 100644 (file)
@@ -23,7 +23,7 @@ char buf[];
        int start, end;
        char ench;
        char urlbuf[256];
-       char outbuf[256];
+       char outbuf[1024];
 
        start = (-1);
        end = strlen(buf);
@@ -61,7 +61,8 @@ char buf[];
        sprintf(&outbuf[start], "%cA HREF=%c%s%c TARGET=%c%s%c%c%s%c/A%c",
                LB, QU, urlbuf, QU, QU, TARGET, QU, RB, urlbuf, LB, RB);
        strcat(outbuf, &buf[end]);
-       strcpy(buf, outbuf);
+       if ( strlen(outbuf) < 250 )
+               strcpy(buf, outbuf);
 }