scrut(1): fix buffer overflow in option parsing #61
Labels
No Label
bug
duplicate
enhancement
help wanted
invalid
joke
question
wontfix
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: bonsai/harakit#61
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "scrut-fix"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
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.I know it’s not part of this PR but on line 60 you
return 1
; shouldn’t that bereturn EX_UNAVAILABLE
?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.
Pull request closed