[PR #1700] [MERGED] Prevent invalid 0-length labels via from_raw_bytes #2532

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

📋 Pull Request Information

Original PR: https://github.com/hickory-dns/hickory-dns/pull/1700
Author: @jonasbb
Created: 4/20/2022
Status: Merged
Merged: 4/24/2022
Merged by: @bluejekyll

Base: mainHead: prevent-0-length-labels


📝 Commits (1)

  • f250738 Prevent invalid 0-length labels via from_raw_bytes

📊 Changes

1 file changed (+6 additions, -0 deletions)

View changed files

📝 crates/proto/src/rr/domain/label.rs (+6 -0)

📄 Description

from_raw_bytes allowed the creation of 0-length labels. This is forbidden according to the DNS standard, e.g., RFC 2181, Section 11 "Name Syntax".
The relevant sentence is

The length of any one label is limited to between 1 and 63 octets.

The from_ascii variant already prevented the creation of 0-length labels.


🔄 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/1700 **Author:** [@jonasbb](https://github.com/jonasbb) **Created:** 4/20/2022 **Status:** ✅ Merged **Merged:** 4/24/2022 **Merged by:** [@bluejekyll](https://github.com/bluejekyll) **Base:** `main` ← **Head:** `prevent-0-length-labels` --- ### 📝 Commits (1) - [`f250738`](https://github.com/hickory-dns/hickory-dns/commit/f2507385ab00c39a481ba21a16b2d817986804b5) Prevent invalid 0-length labels via `from_raw_bytes` ### 📊 Changes **1 file changed** (+6 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `crates/proto/src/rr/domain/label.rs` (+6 -0) </details> ### 📄 Description `from_raw_bytes` allowed the creation of 0-length labels. This is forbidden according to the DNS standard, e.g., RFC 2181, Section 11 "Name Syntax". The relevant sentence is > The length of any one label is limited to between 1 and 63 octets. The `from_ascii` variant already prevented the creation of 0-length labels. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-16 10:06:28 +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#2532
No description provided.