[PR #1802] [MERGED] Simplify interface between BinEncoder and MaximalBuf #2617

Closed
opened 2026-03-16 10:47:46 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/hickory-dns/hickory-dns/pull/1802
Author: @djc
Created: 10/16/2022
Status: Merged
Merged: 10/17/2022
Merged by: @bluejekyll

Base: mainHead: fuzz-bounds


📝 Commits (5)

  • 7e92aac proto: create MaximalBuf::reserve() to replace use of enforced_write()
  • 6c548c8 proto: create MaximalBuf::write() to replace use of enforced_write()
  • fe556e2 proto: remove remaining use of MaximalBuf::enforced_write()
  • 640f5a8 proto: add test case for encoding issue
  • 838cc8f proto: restrict visibility for MaximalBuf API

📊 Changes

2 files changed (+43 additions, -53 deletions)

View changed files

📝 crates/proto/src/serialize/binary/encoder.rs (+43 -53)
crates/proto/tests/test-data/fuzz-long.rdata (+0 -0)

📄 Description

The enforced_write() method defined a pretty complex (and likely slow) interface contract. Add two separate methods to MaximalBuf to replace all uses of enforced_write(). This should fix the issue discovered in https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=52334. At this point I'm not exactly sure in the root cause of the original issue (the fuzzed test case is still quite large), but I'm much more confident in the revised API.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/hickory-dns/hickory-dns/pull/1802 **Author:** [@djc](https://github.com/djc) **Created:** 10/16/2022 **Status:** ✅ Merged **Merged:** 10/17/2022 **Merged by:** [@bluejekyll](https://github.com/bluejekyll) **Base:** `main` ← **Head:** `fuzz-bounds` --- ### 📝 Commits (5) - [`7e92aac`](https://github.com/hickory-dns/hickory-dns/commit/7e92aac2210a710533a6b61f14d124b0e5b3744f) proto: create MaximalBuf::reserve() to replace use of enforced_write() - [`6c548c8`](https://github.com/hickory-dns/hickory-dns/commit/6c548c8411fa49b7472e61705f2112adaeeb9dac) proto: create MaximalBuf::write() to replace use of enforced_write() - [`fe556e2`](https://github.com/hickory-dns/hickory-dns/commit/fe556e2551863717917e1499786955cbc63abfc5) proto: remove remaining use of MaximalBuf::enforced_write() - [`640f5a8`](https://github.com/hickory-dns/hickory-dns/commit/640f5a8805ace160a24d17e57098168e30008eb7) proto: add test case for encoding issue - [`838cc8f`](https://github.com/hickory-dns/hickory-dns/commit/838cc8fcdc70b2333e4b695eda18cf956ded11f2) proto: restrict visibility for MaximalBuf API ### 📊 Changes **2 files changed** (+43 additions, -53 deletions) <details> <summary>View changed files</summary> 📝 `crates/proto/src/serialize/binary/encoder.rs` (+43 -53) ➕ `crates/proto/tests/test-data/fuzz-long.rdata` (+0 -0) </details> ### 📄 Description The `enforced_write()` method defined a pretty complex (and likely slow) interface contract. Add two separate methods to `MaximalBuf` to replace all uses of `enforced_write()`. This should fix the issue discovered in https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=52334. At this point I'm not exactly sure in the root cause of the original issue (the fuzzed test case is still quite large), but I'm much more confident in the revised API. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-16 10:47:46 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/hickory-dns#2617
No description provided.