From 0b08989045af6b096953d033dc8c1fe46f72caed Mon Sep 17 00:00:00 2001 From: Vincent Thiberville Date: Tue, 28 Nov 2023 00:17:36 +0100 Subject: [PATCH] fix: properly check success of pagemap open (#2006) The pagemap_fd value was not checked, probably a bad copy-paste from the mem_fd open just above it. --- libyara/proc/linux.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libyara/proc/linux.c b/libyara/proc/linux.c index bac99fc276..d57788fd04 100644 --- a/libyara/proc/linux.c +++ b/libyara/proc/linux.c @@ -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;