Skip to content

Commit

Permalink
sources/hba.c: fix memory overrun
Browse files Browse the repository at this point in the history
found by coverity

CID 477241: (yandex#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));
  • Loading branch information
chipitsine committed Jun 10, 2024
1 parent 3765e3b commit 9824ba1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion sources/hba.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit 9824ba1

Please sign in to comment.