SELinuxProject/selint

Guideline for internal error checking

Closed this issue · 1 comments

What is the guideline for internal error checking?
For example memory allocations are sometimes checked, sometimes not.
https://github.com/TresysTechnology/selint/blob/318223476dd2eedcc9391c705d082757be1d0862/src/parse_functions.c#L115-L128

Also some functions do return error codes, but some not; and they are not check everywhere
https://github.com/TresysTechnology/selint/blob/318223476dd2eedcc9391c705d082757be1d0862/src/tree.c#L505-L525

I would love to improve internal error checking. As you point out, it's definitely very hit or miss right now. I'd definitely accept PRs to improve all of these sorts of issues.

I had been thinking about adding error checking in parse.y in particular, since it doesn't check the return codes from any of the parse_functions.c functions right now. I don't know when I'll get to that, but if you're going to work on that one in particular, let me know so we don't overlap work.