[PR #1789] [MERGED] Explicit test for label max len and use ProtoErrorKind. #2609

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

📋 Pull Request Information

Original PR: https://github.com/hickory-dns/hickory-dns/pull/1789
Author: @darnuria
Created: 10/7/2022
Status: Merged
Merged: 10/14/2022
Merged by: @djc

Base: mainHead: check/label-len


📝 Commits (5)

  • ef34d24 label: from_ascii add early failture if label too long.
  • 8c1d05e label: In from_raw_bytes Use ProtoErrorKind::LabelBytesTooLong.
  • f2c70ed labels: Add explicit tests for label max len.
  • 49bd2a3 labels: use ProtoErrorKind + test for utf8.
  • c7a9b75 label: add error case in test for from_ascii.

📊 Changes

1 file changed (+79 additions, -2 deletions)

View changed files

📝 crates/proto/src/rr/domain/label.rs (+79 -2)

📄 Description

While reviewing code for #1787 I found that some Label making code authorized enforcing with label length superior to 63 bytes has no explicit testing.
Also moved to use ProtoErrorKind::LabelBytesTooLong instead of text error.

Code bout utf8 might be splited into an other pr I chooses to recheck manually since the error is opaque.

EDIT: it's Friday... rephrased the message it was just gibbering
If anything is wrong:

  • removing the usage of ProtoErrorKind::LabelBytesTooLong
  • Just keeping the test with strings
  • or remove the early failure

Please tell me. :)


🔄 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/1789 **Author:** [@darnuria](https://github.com/darnuria) **Created:** 10/7/2022 **Status:** ✅ Merged **Merged:** 10/14/2022 **Merged by:** [@djc](https://github.com/djc) **Base:** `main` ← **Head:** `check/label-len` --- ### 📝 Commits (5) - [`ef34d24`](https://github.com/hickory-dns/hickory-dns/commit/ef34d24f87d8087636cf41e581ba733d5c424b2d) label: from_ascii add early failture if label too long. - [`8c1d05e`](https://github.com/hickory-dns/hickory-dns/commit/8c1d05ef2fab446bc15f223fa1bedea1b5c8fb5e) label: In from_raw_bytes Use ProtoErrorKind::LabelBytesTooLong. - [`f2c70ed`](https://github.com/hickory-dns/hickory-dns/commit/f2c70eddaf854e6748045a271f515cb6fff4d4f3) labels: Add explicit tests for label max len. - [`49bd2a3`](https://github.com/hickory-dns/hickory-dns/commit/49bd2a3697376e9ceefd293f2c53cb77d6d5a08b) labels: use ProtoErrorKind + test for utf8. - [`c7a9b75`](https://github.com/hickory-dns/hickory-dns/commit/c7a9b7525b363ec0e85f75e5827c2867a2f22364) label: add error case in test for from_ascii. ### 📊 Changes **1 file changed** (+79 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `crates/proto/src/rr/domain/label.rs` (+79 -2) </details> ### 📄 Description While reviewing code for #1787 I found that some `Label` making code ~authorized~ enforcing with label length superior to 63 bytes has no explicit testing. Also moved to use `ProtoErrorKind::LabelBytesTooLong` instead of text error. Code bout utf8 might be splited into an other pr I chooses to recheck manually since the error is opaque. EDIT: it's Friday... rephrased the message it was just gibbering If anything is wrong: - removing the usage of `ProtoErrorKind::LabelBytesTooLong` - Just keeping the test with strings - or remove the early failure Please tell me. :) --- <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:10 +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#2609
No description provided.