SELinuxProject / selint

Static code analysis of refpolicy style SELinux policy
Apache License 2.0
38 stars 17 forks source link

Reduce recursion in free_policy_node #255

Closed cgzones closed 1 year ago

cgzones commented 1 year ago

Loop over the nodes in the next list instead of making a recursive call. Otherwise, together with the recursive call on the child nodes, the call stack might exceed the system limit, e.g. on s390x where the maximum size a process may lock into memory is quite small (8192 kB).

dburgener commented 1 year ago

This seems fine except for the one minor naming comment. I do wonder if just switching the recursion order would work too, but this commit should be even better.

dburgener commented 1 year ago

Merged, thanks!