Index: ossp-pkg/lmtp2nntp/00TODO RCS File: /v/ossp/cvs/ossp-pkg/lmtp2nntp/00TODO,v rcsdiff -q -kk '-r1.23' '-r1.24' -u '/v/ossp/cvs/ossp-pkg/lmtp2nntp/00TODO,v' 2>/dev/null --- 00TODO 2001/08/30 08:58:19 1.23 +++ 00TODO 2001/08/30 13:38:04 1.24 @@ -1,8 +1,6 @@ whatsup draufleiten -ID logging problem, RFC1891 ENVID, 6.2 -lmtp_response segfaults when a physical line ('\n' terminated) of the logical line input exceeds LMTP_LINE_MAXLEN. -manpage header reads "User Contributed Perl Documentation" - Perl!? +ID logging, RFC1891 ENVID, 6.2 **** LMTP REDESIGN **** Index: ossp-pkg/lmtp2nntp/lmtp.c RCS File: /v/ossp/cvs/ossp-pkg/lmtp2nntp/Attic/lmtp.c,v rcsdiff -q -kk '-r1.18' '-r1.19' -u '/v/ossp/cvs/ossp-pkg/lmtp2nntp/Attic/lmtp.c,v' 2>/dev/null --- lmtp.c 2001/08/29 14:58:21 1.18 +++ lmtp.c 2001/08/30 13:38:04 1.19 @@ -346,15 +346,23 @@ len = sprintf(formatbuf, "%3.3s%c%5.5s ", res->statuscode, dash ? '-' : ' ', res->dsncode); else len = sprintf(formatbuf, "%3.3s%c", res->statuscode, dash ? '-' : ' '); + if ((len + cpE - cpS + 2) > sizeof(formatbuf)) { /* status + line + '\r\n' does not fit into formatbuf */ + dash = 1; + if ((cpE = cpS + sizeof(formatbuf) - 2 - len) <= cpS) /* no space for line at all */ + return LMTP_ERR_ARG; + } strncpy(formatbuf+len, cpS, cpE-cpS); len += (cpE-cpS); + formatbuf[len++] = '\r'; formatbuf[len++] = '\n'; do { rv = lmtp->io.write(lmtp->wfd, formatbuf, len); } while (rv == -1 && errno == EINTR); if (rv == -1) return LMTP_ERR_SYSTEM; - cpS = cpE+1; + cpS = cpE; + if (*cpS == '\n') + cpS++; } return rc; }