--- powwow.c.old Mon Apr 28 18:56:28 1997 +++ powwow.c Tue Jan 20 13:40:26 1998 @@ -660,6 +660,7 @@ char onlyprompt = 1, *line, *end; int mpilen = strlen(MPI); char buf2[LINELEN]; + static int last_was_nl = 0; /* Cosmos: fix MPI-in-whois security hole */ /* process block one line at a time: */ @@ -672,17 +673,20 @@ */ for (line = buf; buf < end; buf++) { if (*buf == '\n') { + last_was_nl = 1; *buf = '\0'; if (buf > line && buf[-1] == '\r') buf[-1] = '\0'; buf++; - while (buf < end && *buf == '\r') + if (buf < end && *buf == '\r') { + last_was_nl = 0; *buf++ = '\0'; + } break; } } - if(!strncmp(MPI, line, mpilen)) + if(last_was_nl && !strncmp(MPI, line, mpilen)) buf += process_message(line + mpilen, end - line - mpilen) + mpilen; else { if(buf == end && printstrlen(line) < cols) {