Skip to content

Commit

Permalink
apparmor: properly check lxc_strmmap ret value
Browse files Browse the repository at this point in the history
Reported-by: coverity (CID #1517320)
Signed-off-by: Alexander Mikhalitsyn <[email protected]>
  • Loading branch information
mihalicyn committed Dec 12, 2022
1 parent 667292a commit 6ea4a6c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/lxc/lsm/apparmor.c
Original file line number Diff line number Diff line change
Expand Up @@ -975,7 +975,7 @@ static int load_apparmor_profile(struct lsm_ops *ops, struct lxc_conf *conf, con
old_len = profile_sb.st_size;
old_content = lxc_strmmap(NULL, old_len, PROT_READ,
MAP_PRIVATE, profile_fd, 0);
if (!old_content) {
if (old_content == MAP_FAILED) {
SYSERROR("Failed to mmap old profile from %s",
profile_path);
goto out;
Expand Down

0 comments on commit 6ea4a6c

Please sign in to comment.