]> git.ipfire.org Git - thirdparty/git.git/commit
imap: replace atoi() with strtol_i() for UIDVALIDITY and UIDNEXT parsing
authorUsman Akinyemi <usmanakinyemi202@gmail.com>
Thu, 24 Oct 2024 00:24:58 +0000 (00:24 +0000)
committerTaylor Blau <me@ttaylorr.com>
Thu, 24 Oct 2024 18:03:44 +0000 (14:03 -0400)
commite226ba81a2520263580721b1527794428923cd67
treed55964be56439ced2ce032874099b7a36ff1709c
parente36f009e69b68a82f216f9633f99198421a67f12
imap: replace atoi() with strtol_i() for UIDVALIDITY and UIDNEXT parsing

Replace 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.
I did not add any test for this commit as we do not have any test
for git-imap-send(1) at this point.

Signed-off-by: Usman Akinyemi <usmanakinyemi202@gmail.com>
Signed-off-by: Taylor Blau <me@ttaylorr.com>
imap-send.c