Thread (94 messages) 94 messages, 6 authors, 2024-11-06

Re: [PATCH v2 3/3] imap: replace atoi() with strtol_i() for UIDVALIDITY and UIDNEXT parsing

From: Taylor Blau <hidden>
Date: 2024-10-21 16:35:46

On Mon, Oct 21, 2024 at 02:38:40PM +0000, Usman Akinyemi wrote:
On Mon, Oct 21, 2024 at 2:01 PM Patrick Steinhardt [off-list ref] wrote:
quoted
On Mon, Oct 21, 2024 at 12:27:05PM +0000, Usman Akinyemi wrote:
quoted
On Mon, Oct 21, 2024 at 12:20 PM Patrick Steinhardt [off-list ref] wrote:
quoted
On Fri, Oct 18, 2024 at 01:53:00PM +0000, Usman Akinyemi via GitGitGadget wrote:
quoted
From: Usman Akinyemi <redacted>

Replaced unsafe uses of atoi() with strtol_i() to improve error handling
when parsing UIDVALIDITY, UIDNEXT, and APPENDUID in IMAP commands.
Invalid values, such as those with letters,
now trigger error messages and prevent malformed status responses.
The line break after "letters," is a bit funny.
I just noticed that I will change it.
quoted
It would also be nice to point out why this commit doesn't add any new
tests. I guess the answer is that we don't have any tests for
git-imap-send(1) at all, which is too bad, but a fair excuse and not a
problem of your patch. So introducing such tests would be too much to
ask.
I can try, but, why was it not introduced before, is there a reason ?
I think it's mostly that we'd have to have an IMAP server available to
test sending emails properly, so the test setup would be comparatively
involved. Nobody felt like doing that, and thus we don't have any tests
:)
Ohh, I see. I have not set up an IMAP server before though. I can take
it up but might require some level of guidance.
I think what Patrick is saying is that it's probably not worth the
effort to do so for an automated test, especially if the code change is
trivial by comparison.

Thanks,
Taylor
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help