Skip to content

Fix buffer overread in rr2str() function#2

Open
drmckay wants to merge 1 commit intoSkyperTHC:mainfrom
drmckay:fix/buffer-overread-rr2str
Open

Fix buffer overread in rr2str() function#2
drmckay wants to merge 1 commit intoSkyperTHC:mainfrom
drmckay:fix/buffer-overread-rr2str

Conversation

@drmckay
Copy link

@drmckay drmckay commented Dec 21, 2025

Summary

  • Add bounds checking to prevent buffer overread in rr2str() when parsing DNS records
  • Handle DNS compression pointers (0xC0 prefix) properly by skipping 2 bytes
  • Validate pointer bounds before reading label length and copying data

Issue Reference

Fixes #1

Add bounds checking to prevent buffer overread when parsing DNS records:
- Check if ptr >= end before reading label length
- Handle DNS compression pointers (0xC0 prefix) properly
- Validate ptr + l doesn't exceed buffer end before copying

Fixes SkyperTHC#1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Out-of-Bounds Read in rr2str() - Missing Bounds Checks & Compression Pointer Mishandling

1 participant