melib/nntp: accept invalid (non-ascii) address comment text #270

Merged
Manos Pitsidianakis merged 3 commits from fix/269-invalid-ctext-loop into master 2023-08-10 18:38:48 +03:00

3 Commits (master)

Author SHA1 Message Date
Manos Pitsidianakis 448e0635e0
melib/nntp: log error when command length exceeds 512 octets
Tests / Test on ${{ matrix.build }} (linux-amd64, ubuntu-latest, stable, x86_64-unknown-linux-gnu) (push) Failing after 8m59s Details
According to RFC 3977:

> Command lines MUST NOT exceed 512 octets, which includes the
> terminating CRLF pair

This commit adds a log::error entry when any sent command exceeds that
limit and recommends the user to report this as a bug.
2023-08-10 18:31:22 +03:00
Manos Pitsidianakis 4e654d2d02
melib/nntp: limit LIST ACTIVE command length to 512 octets
According to RFC 3977:

> Command lines MUST NOT exceed 512 octets, which includes the
> terminating CRLF pair

Sending a `LIST ACTIVE` command with lots of newgroups and passing the
512 byte limit is therefore invalid. This commit splits the mailboxes in
chunks and sends a separate command for each maximal chunk that has
a valid length.

Fixes #269.

Reported-by: r3k2
2023-08-10 18:30:59 +03:00
Manos Pitsidianakis 40d4ecefa0
melib/nntp: accept invalid (non-ascii) address comment text
NNTP servers may return addresses that are not RFC 5322 compliant. An
address with a comment with non-ascii characters will make the parser loop indefinitely.

Fixes #269.
2023-08-10 18:29:58 +03:00