* tools.c, tools.h: new files; misc routines used by both client and
server go here. contains safestrncpy() at the moment.
* rooms.c: fix several exploitable buffer overruns
+ * sysdep.c: fix infinite loop when long lines are received from the
+ client; fix exploitable buffer overrun in cprintf()
* .cvsignore: add *.ro
Sun Oct 11 23:17:48 EDT 1998 Art Cancro <ajc@uncnsrd.mt-kisco.ny.us>
int rc;
va_start(arg_ptr, format);
- rc = vsprintf(buf, format, arg_ptr);
+ rc = vsnprintf(buf, sizeof buf, format, arg_ptr);
va_end(arg_ptr);
client_write(buf, strlen(buf));
buf[strlen(buf) + 1] = 0;
retval = client_read(&buf[strlen(buf)], 1);
}
+ else break;
} while ( (buf[strlen(buf)-1] != 10) && (retval==1) );
/* Strip the trailing newline.