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

Fix NLnetLabs#981: dump_cache truncates large records. #988

Merged
merged 1 commit into from
Jan 9, 2024

Conversation

dyunwei
Copy link
Contributor

@dyunwei dyunwei commented Jan 9, 2024

The issue lies in the buffer sizes used by two functions: dump_rrset_line, which has a buffer size of 65535 to store a rrset string, and ssl_print_vmsg, which has a buffer size of only 1024 for printing a message. This mismatch is the root cause of the truncation.

To resolve this issue, I increased the output message buffer size from 1024 to 65535 to match the buffer size used for rrset strings. Additionally, I verified if the rrset string is truncated in packed_rr_to_string; if it is, unbound will output "BADRR" instead of printing the truncated message.

@dyunwei dyunwei closed this Jan 9, 2024
@dyunwei dyunwei reopened this Jan 9, 2024
@wcawijngaards wcawijngaards linked an issue Jan 9, 2024 that may be closed by this pull request
Copy link
Member

@wcawijngaards wcawijngaards left a comment

Choose a reason for hiding this comment

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

The code change looks good. It fixes an inconsistency in buffer sizes.

@wcawijngaards wcawijngaards merged commit 9cd724c into NLnetLabs:master Jan 9, 2024
2 checks passed
wcawijngaards added a commit that referenced this pull request Jan 9, 2024
- Merge #988: Fix #981: dump_cache truncates large records.
@wcawijngaards
Copy link
Member

Thank you for the fix, that looks to be the cause of the issue! The code is merged into the code repository.

jedisct1 added a commit to jedisct1/unbound that referenced this pull request Jan 14, 2024
* nlnet/master:
  Changelog note for NLnetLabs#988. - Merge NLnetLabs#988: Fix NLnetLabs#981: dump_cache truncates large records.
  Fix NLnetLabs#981: dump_cache truncates large records.
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.

dump_cache truncates large records
2 participants