]> code.citadel.org Git - citadel.git/commitdiff
* citserver.c: fix two more overruns, one of which was preventing
authorNathan Bryant <loanshark@uncensored.citadel.org>
Sun, 11 Oct 1998 18:45:35 +0000 (18:45 +0000)
committerNathan Bryant <loanshark@uncensored.citadel.org>
Sun, 11 Oct 1998 18:45:35 +0000 (18:45 +0000)
          the "From Host" from showing up in the <W>ho listing.

citadel/ChangeLog
citadel/citserver.c

index d840f0ae428a33c17c33de149f95fcc5d83376be..05268207a33ebd8c311f83b29a6b79e5a72140b9 100644 (file)
@@ -1,3 +1,7 @@
+1998-10-11 Nathan Bryant <bryant@cs.usm.maine.edu>
+       * citserver.c: fix two more overruns, one of which was preventing
+         the "From Host" from showing up in the <W>ho listing.
+
 Sun Oct 11 02:51:55 EDT 1998 Art Cancro <ajc@uncnsrd.mt-kisco.ny.us>
        * Moved "struct visit" and its associated defs from citadel.h to
          server.h where they belong
index 6b013926a11fcbe1ee3d51a7946159666653c256..8bc4541fdff14d9829dcabc921cfe87e7f3ec0aa 100644 (file)
@@ -132,8 +132,8 @@ void cleanup_stuff(void *arg)
  */
 void set_wtmpsupp(char *newtext)
 {
-       strncpy(CC->cs_room,newtext,ROOMNAMELEN-1);
-       CC->cs_room[ROOMNAMELEN-1] = 0;
+       strncpy(CC->cs_room,newtext,sizeof CC->cs_room);
+       CC->cs_room[sizeof CC->cs_room - 1] = 0;
        time(&CC->cs_lastupdt);
 
        /* Run any routines registered by loadable modules */
@@ -278,7 +278,8 @@ void cmd_iden(char *argbuf)
        rev_level = extract_int(argbuf,2);
        extract(desc,argbuf,3);
 
-       strcpy(from_host,config.c_fqdn);
+       strncpy(from_host,config.c_fqdn,sizeof from_host);
+       from_host[sizeof from_host - 1] = 0;
        if (num_parms(argbuf)>=5) extract(from_host,argbuf,4);
 
        CC->cs_clientdev = dev_code;