[GH-ISSUE #1709] I found a recursion which may cause stack overflow error #740

Open
opened 2026-03-16 00:05:30 +03:00 by kerem · 1 comment
Owner

Originally created by @Ren-ZY on GitHub (May 21, 2022).
Original GitHub issue: https://github.com/hickory-dns/hickory-dns/issues/1709

The function read_inner at crates/proto/src/rr/domain/name.rs: 981:1: 981:93 is a recursive function.
Maybe Some special input can make it recursive deeply and cause stack overflow?

For example:
let btyes = vec![..............];
let mut d = BinDecoder::new(&bytes);
Name::read(&mut d);

Originally created by @Ren-ZY on GitHub (May 21, 2022). Original GitHub issue: https://github.com/hickory-dns/hickory-dns/issues/1709 The function *read_inner* at crates/proto/src/rr/domain/name.rs: 981:1: 981:93 is a recursive function. Maybe Some special input can make it recursive deeply and cause stack overflow? For example: let btyes = vec![..............]; let mut d = BinDecoder::new(&bytes); Name::read(&mut d);
Author
Owner

@bluejekyll commented on GitHub (May 22, 2022):

Have you been able to create a stack overflow? The read_inner recursion has a requirement that it must point to an earlier section of the message for the compressed label. This bounds the read_inner in the sense that it can't infinitely recurse, eventually it would stop at the first index of the message.

<!-- gh-comment-id:1133807528 --> @bluejekyll commented on GitHub (May 22, 2022): Have you been able to create a stack overflow? The `read_inner` recursion has a requirement that it must point to an earlier section of the message for the compressed label. This bounds the `read_inner` in the sense that it can't infinitely recurse, eventually it would stop at the first index of the message.
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#740
No description provided.