From 9824ba1b5bfdf3cd93d8667036317fa62deb2e67 Mon Sep 17 00:00:00 2001 From: Ilia Shipitsin Date: Mon, 10 Jun 2024 19:43:51 +0200 Subject: [PATCH] sources/hba.c: fix memory overrun found by coverity CID 477241: (#1 of 1): Out-of-bounds access (OVERRUN) 1. overrun-buffer-arg: Overrunning buffer pointed to by &rules of 8 bytes by passing it to a function which accesses it at byte offset 15 using argument 16UL. 37 memcpy(&hba->rules, &rules, sizeof(hba->rules)); --- sources/hba.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/hba.c b/sources/hba.c index 4badc9f00..ad637d6df 100644 --- a/sources/hba.c +++ b/sources/hba.c @@ -34,7 +34,7 @@ void od_hba_reload(od_hba_t *hba, od_hba_rules_t *rules) od_hba_lock(hba); od_list_init(&hba->rules); - memcpy(&hba->rules, &rules, sizeof(hba->rules)); + memcpy(&hba->rules, &rules, sizeof(rules)); od_hba_unlock(hba); }