mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 11:37:34 +00:00
LibDNS: Make DNS packet parsing fallible
Previously, a DNS packet containing an invalid name would be returned with an empty name. With this change, an error is returned if any error is encountered during parsing.
This commit is contained in:
parent
95d62822bf
commit
1793f51bc6
8 changed files with 29 additions and 40 deletions
|
@ -17,7 +17,7 @@ public:
|
|||
Name() = default;
|
||||
Name(DeprecatedString const&);
|
||||
|
||||
static Name parse(ReadonlyBytes data, size_t& offset, size_t recursion_level = 0);
|
||||
static ErrorOr<Name> parse(ReadonlyBytes data, size_t& offset, size_t recursion_level = 0);
|
||||
|
||||
size_t serialized_size() const;
|
||||
DeprecatedString const& as_string() const { return m_name; }
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue