Commit 40cd9d8
parse: replace atoi() with strtoul_ui() and strtol_i()
Replace unsafe uses of atoi() with strtoul_ui() for unsigned integers
and strtol_i() for signed integers across multiple files. This change
improves error handling and prevents potential integer overflow issues.
The following files were updated:
- daemon.c: Update parsing of --timeout, --init-timeout, and
--max-connections
- imap-send.c: Improve parsing of UIDVALIDITY, UIDNEXT, APPENDUID, and
tags
- merge-ll.c: Enhance parsing of marker size in ll_merge and
ll_merge_marker_size
This change allows for better error detection when parsing integer
values from command-line arguments and IMAP responses, making the code
more robust and secure.
This is a #leftoverbit discussed here:
https://public-inbox.org/git/CAC4O8c-nuOTS=a0sVp1603KaM2bZjs+yNZzdAaa5CGTNGFE7hQ@mail.gmail.com/
Signed-off-by: Usman Akinyemi <[email protected]>
Cc: [email protected]
Cc: Patrick Steinhardt <[email protected]>
Cc: [email protected]
Cc: Christian Couder <[email protected]>
Cc: Eric Sunshine <[email protected]>
Cc: Taylor Blau <[email protected]>
Signed-off-by: Taylor Blau <[email protected]>1 parent 19c291e commit 40cd9d8
3 files changed
+19
-14
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1308 | 1308 | | |
1309 | 1309 | | |
1310 | 1310 | | |
1311 | | - | |
| 1311 | + | |
| 1312 | + | |
| 1313 | + | |
1312 | 1314 | | |
1313 | 1315 | | |
1314 | 1316 | | |
1315 | | - | |
| 1317 | + | |
| 1318 | + | |
| 1319 | + | |
1316 | 1320 | | |
1317 | 1321 | | |
1318 | 1322 | | |
1319 | | - | |
1320 | | - | |
1321 | | - | |
| 1323 | + | |
| 1324 | + | |
| 1325 | + | |
1322 | 1326 | | |
1323 | 1327 | | |
1324 | 1328 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
668 | 668 | | |
669 | 669 | | |
670 | 670 | | |
671 | | - | |
| 671 | + | |
672 | 672 | | |
673 | 673 | | |
674 | 674 | | |
675 | 675 | | |
676 | | - | |
| 676 | + | |
677 | 677 | | |
678 | 678 | | |
679 | 679 | | |
| |||
686 | 686 | | |
687 | 687 | | |
688 | 688 | | |
689 | | - | |
690 | | - | |
| 689 | + | |
| 690 | + | |
691 | 691 | | |
692 | 692 | | |
693 | 693 | | |
| |||
773 | 773 | | |
774 | 774 | | |
775 | 775 | | |
776 | | - | |
| 776 | + | |
| 777 | + | |
| 778 | + | |
| 779 | + | |
777 | 780 | | |
778 | 781 | | |
779 | 782 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
427 | 427 | | |
428 | 428 | | |
429 | 429 | | |
430 | | - | |
431 | | - | |
| 430 | + | |
432 | 431 | | |
433 | 432 | | |
434 | 433 | | |
| |||
454 | 453 | | |
455 | 454 | | |
456 | 455 | | |
457 | | - | |
458 | | - | |
| 456 | + | |
459 | 457 | | |
460 | 458 | | |
461 | 459 | | |
| |||
0 commit comments