Skip to content

Commit

Permalink
fix: properly check success of pagemap open (#2006)
Browse files Browse the repository at this point in the history
The pagemap_fd value was not checked, probably a bad copy-paste from the
mem_fd open just above it.
  • Loading branch information
vthib authored Nov 27, 2023
1 parent 4a90198 commit 0b08989
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion libyara/proc/linux.c
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ int _yr_process_attach(int pid, YR_PROC_ITERATOR_CTX* context)
snprintf(buffer, sizeof(buffer), "/proc/%u/pagemap", pid);
proc_info->pagemap_fd = open(buffer, O_RDONLY);

if (proc_info->mem_fd == -1)
if (proc_info->pagemap_fd == -1)
goto err;

context->proc_info = proc_info;
Expand Down

0 comments on commit 0b08989

Please sign in to comment.