anntp

a nntp implementation in pure C99
Log | Files | Refs | README | LICENSE

commit c37b61f3d3e5fd204f8b76389a5b9be51ecbcfa4
parent a4020fd17551517b9cadda9d0bbed51bc5a30773
Author: Mario Rosell R. Martinez <mario@mariorosell.es>
Date:   Thu, 19 Mar 2026 19:39:58 +0100

buf,sec: Fix buffer overflow and dot-stuffing.

Diffstat:
Manntp.h | 4++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/anntp.h b/anntp.h @@ -284,7 +284,7 @@ anntp_readdot(AnntpConnection* cv, char* buf, size_t maxlen) ssize_t n; for (;;) { - n = anntp_readline(cv, line, sizeof(line)); + n = anntp_readline(cv, line, ANNTP_BUFSIZE); if (n <= 0) break; /* closed or error */ @@ -294,7 +294,7 @@ anntp_readdot(AnntpConnection* cv, char* buf, size_t maxlen) /* lines starting with .. are dot-stuffed, do a /^\.\././ ;) */ char* out = line; - if (line[0] == '.', line[1] == '.') + if (line[0] == '.' && line[1] == '.') ++out; size_t len = strlen(out);