Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
apparmor: fix incorrect usage of sizeof on char ptr
In criu/apparmor.c: write_aa_policy(), the arg path is passed as a char pointer. The original code used sizeof(path) to get the size of it, which is incorrect as it always return the size of the char pointer (typically 8 or 4), not the actual capacity of the char array. Given that this function is only invoked with path declared as `char path[PATH_MAX]`, replacing sizeof(path) with PATH_MAX should correctly represent the maximum size of it. Signed-off-by: Haorong Lu <[email protected]>
- Loading branch information