Skip to content

sources/hba.c: fix memory overrun #618

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 11, 2024
Merged

sources/hba.c: fix memory overrun #618

merged 1 commit into from
Jun 11, 2024

Conversation

chipitsine
Copy link
Contributor

@chipitsine chipitsine commented Jun 10, 2024

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));

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));
Copy link
Collaborator

@x4m x4m left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I officially hate C-style lists.
Thanks for fixing this.

@x4m x4m merged commit f899d63 into yandex:master Jun 11, 2024
@chipitsine chipitsine deleted the f477241 branch June 11, 2024 10:08
@chipitsine
Copy link
Contributor Author

I officially hate C-style lists. Thanks for fixing this.

I think that ASAN should have caught that.

is there a probability that some functions are not covered by tests ?
maybe we should invest into coverage (which is relatively easy)

@x4m
Copy link
Collaborator

x4m commented Jun 11, 2024

Well, exactly this one is not exercised in HBA tests.
https://github.com/yandex/odyssey/blob/master/docker/hba/test.sh

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants