1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 01:47:35 +00:00

LibIMAP: Make parsing of atom data fallible

We now return an error where `parse_atom()` would have previously
returned an empty StringView. This is consistent with RFC3501, which
says that an atom consists of one or more characters.

This prevents a few cases where parsing an invalid atom could lead to
an infinite loop.
This commit is contained in:
Tim Ledbetter 2023-11-07 13:34:12 +00:00 committed by Andreas Kling
parent b96a5f4265
commit 4b995542c4
2 changed files with 11 additions and 9 deletions

View file

@ -41,7 +41,7 @@ private:
ErrorOr<void> parse_untagged();
ErrorOr<void> parse_capability_response();
StringView parse_atom();
ErrorOr<StringView> parse_atom();
ErrorOr<StringView> parse_quoted_string();
ErrorOr<StringView> parse_literal_string();
ErrorOr<StringView> parse_string();