librespot-org / libmdns

mDNS Responder library for building discoverable LAN services in Rust
https://crates.io/crates/libmdns
MIT License
71 stars 34 forks source link

DNS parsing can cause crash due to infinite recursion #56

Open jmaygarden opened 4 months ago

jmaygarden commented 4 months ago

The name parsing uses a u16 offset and recurses without checking if the value is zero. That may cause an infinite loop that blows up the stack and crashes the process.

See https://github.com/tailhook/dns-parser/commit/c840c1715a322d4f99c8dc927277070b3df63726 for a fix.

willstott101 commented 3 months ago

Thanks, I'll try and get this integrated this weekend. Medium-term I think it would be best for this library to switch to a maintained external DNS serialization library though.