Skip to content
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

tree_insert() allows duplicate entries, leading to usertable corruption and authentication failures #11

Closed
kartiksubbarao opened this issue Oct 16, 2022 · 1 comment

Comments

@kartiksubbarao
Copy link
Contributor

kartiksubbarao commented Oct 16, 2022

I recently noticed intermittent authentication failures that I tracked down to duplicate user entries in the usertable. For example, this mavis_lookup_final() logic often tries to add duplicates, which tree_insert() is intended to stop. The problem is that the duplicate checking doesn't happen until the new node is already positioned in the RB tree, by which time some duplicates could have already been missed. (e.g. insert A, B, A causes the duplicate A to be added).

Fortunately, the fix is simple -- just move the duplicate detection a few lines up to the positioning section. I'll submit a pull request.

@kartiksubbarao
Copy link
Contributor Author

pull request: #12

MarcJHuber added a commit that referenced this issue Oct 16, 2022
Fix tree_insert() duplicate detection logic, resolves #11
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

No branches or pull requests

1 participant