Replace the flake URI "parsers" (regexes) with parsers #417

Open
opened 2024-06-24 22:37:49 +00:00 by jade · 0 comments
Owner

These are completely busted, there is no way they are not full of bugs, and they are pretty well incomprehensible.

i would Not trust that parser as far as i can throw it

- @jade_:matrix.org, 2024-06-19

Thanks to @pennae putting pegtl in tree, we can start rewriting regexes as actual parsers.

These parsers have regressed before and they will regress again. Anyone proposing to fix these needs to fuzz them; this is absolutely mandatory given how absolutely scuffed they are.

flakeRegex: http://regexr.com/82215
pathUrlRegex: https://regexr.com/82218

The affected parsers are in parseFlakeRefWithFragment: 35eec921af/src/libexpr/flake/flakeref.cc (L72-L77)

These are completely busted, there is no way they are not full of bugs, and they are pretty well incomprehensible. > i would Not trust that parser as far as i can throw it \- @jade_:matrix.org, 2024-06-19 Thanks to @pennae putting pegtl in tree, we can start rewriting regexes as actual parsers. These parsers have regressed before and they will regress again. Anyone proposing to fix these needs to fuzz them; this is absolutely mandatory given how absolutely scuffed they are. flakeRegex: http://regexr.com/82215 pathUrlRegex: https://regexr.com/82218 The affected parsers are in `parseFlakeRefWithFragment`: https://git.lix.systems/lix-project/lix/src/35eec921af1043fc6322edc0ad88c872d41623b8/src/libexpr/flake/flakeref.cc#L72-L77
jade added the
stability
E/hard
Area/flakes
labels 2024-06-24 22:37:49 +00:00
jade added this to the Broken regexes project 2024-06-24 23:47:42 +00:00
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: lix-project/lix#417
No description provided.