linux-application-whitelisting / fapolicyd

File Access Policy Daemon
GNU General Public License v3.0
192 stars 55 forks source link

Introduce format number 3 in a trust file #231

Closed radosroka closed 1 year ago

radosroka commented 1 year ago
stevegrubb commented 1 year ago

In parse_line_backwards, there is a variable delim being set to a space. It might be more efficient to make it a define SPACE ' ' so that it does not have to load a space into a variable on each call.

There is another variable delims. In the same function it looks like it loops collecting up addresses of delimiters and has a running total in count. The loop afterwards sets all addresses to 0. But it uses MAX_DELIMS instead of count for the loop maximum. If count was 1, then the second adrdess would be a random address that will get zeroed. I know there are supposed to be 2 delimiters, but it's safer to return an error if 2 are not found.

Otherwise, looks good.

radosroka commented 1 year ago

Fixed.