scrut(1): fix buffer overflow in option parsing #61

Closed
trinity wants to merge 0 commits from scrut-fix into main
Owner

Fixes #40.

Rather than having a list of options specified, has "slots" with options either present as their character or as '\0'; that way only (sizeof ops) / (sizeof *ops) vector members are ever used at once.

Fixes #40. Rather than having a list of options specified, has "slots" with options either present as their character or as `'\0'`; that way only `(sizeof ops) / (sizeof *ops)` vector members are ever used at once.
trinity added 1 commit 2024-02-16 01:16:40 -07:00
trinity requested review from emma 2024-02-16 01:17:30 -07:00
trinity requested review from silt 2024-02-16 01:17:30 -07:00
emma approved these changes 2024-02-16 21:21:11 -07:00
Owner

I know it’s not part of this PR but on line 60 you return 1; shouldn’t that be return EX_UNAVAILABLE?

I know it’s not part of this PR but on line 60 you `return 1`; shouldn’t that be `return EX_UNAVAILABLE`?
Author
Owner

scrut(1) exits 0 if the opted requirements are met, 1 otherwise. The file not existing is the requirements not being met. scrut(1) only returns sysexits(3) values in the case of an error. However I should change the return values to EXIT_SUCCESS / EXIT_FAILURE - they're clearer.

scrut(1) exits 0 if the opted requirements are met, 1 otherwise. The file not existing is the requirements not being met. scrut(1) only returns sysexits(3) values in the case of an error. However I should change the return values to EXIT_SUCCESS / EXIT_FAILURE - they're clearer.
trinity closed this pull request 2024-02-17 23:15:30 -07:00

Pull request closed

Sign in to join this conversation.
No reviewers
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: bonsai/harakit#61
No description provided.