[PR #150] [MERGED] Fix possible panic in Name::zone_of #1268

Closed
opened 2026-03-16 01:57:16 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/hickory-dns/hickory-dns/pull/150
Author: @SAPikachu
Created: 6/24/2017
Status: Merged
Merged: 6/24/2017
Merged by: @bluejekyll

Base: masterHead: fix-panic-zone-of


📝 Commits (2)

  • 96b17db Fix possible panic in Name::zone_of
  • c8e6931 More test for Name::zone_of

📊 Changes

1 file changed (+14 additions, -1 deletions)

View changed files

📝 client/src/rr/domain.rs (+14 -1)

📄 Description

Calling Name::zone_of would panic (attempt to subtract with overflow) if either self or name is root. Fixing that.

Also we can return early when self_len > name_len.


🔄 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/150 **Author:** [@SAPikachu](https://github.com/SAPikachu) **Created:** 6/24/2017 **Status:** ✅ Merged **Merged:** 6/24/2017 **Merged by:** [@bluejekyll](https://github.com/bluejekyll) **Base:** `master` ← **Head:** `fix-panic-zone-of` --- ### 📝 Commits (2) - [`96b17db`](https://github.com/hickory-dns/hickory-dns/commit/96b17dbda46ed0b8398fbfeb6a15d4b50f1ce99f) Fix possible panic in Name::zone_of - [`c8e6931`](https://github.com/hickory-dns/hickory-dns/commit/c8e69317dc95f6d85f80d738c5f22ae19b312650) More test for Name::zone_of ### 📊 Changes **1 file changed** (+14 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `client/src/rr/domain.rs` (+14 -1) </details> ### 📄 Description Calling Name::zone_of would panic (`attempt to subtract with overflow`) if either `self` or `name` is root. Fixing that. Also we can return early when `self_len > name_len`. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-16 01:57:16 +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#1268
No description provided.