Page MenuHomeFreeBSD

libucl: Fix bugs in C-style comment parser
ClosedPublic

Authored by des on Sep 30 2025, 8:52 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sun, Dec 7, 10:34 PM
Unknown Object (File)
Thu, Dec 4, 1:06 AM
Unknown Object (File)
Fri, Nov 28, 7:21 AM
Unknown Object (File)
Wed, Nov 26, 5:21 AM
Unknown Object (File)
Tue, Nov 25, 9:03 PM
Unknown Object (File)
Thu, Nov 13, 9:43 AM
Unknown Object (File)
Wed, Nov 12, 1:19 AM
Unknown Object (File)
Mon, Nov 10, 7:16 PM
Subscribers

Details

Summary

When an asterisk is encountered inside a C-style comment, we first check
if there is at least one more character left in the buffer, and if that
character is a slash, which would terminate the comment. If that is not
the case, the next two characters are consumed without being inspected.
If one of those is a double quote, or the initial asterisk of an
asterisk-slash pair, we end up misparsing the comment.

MFC after: 3 days

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

des requested review of this revision.Sep 30 2025, 8:52 PM

This has also been submitted upstream as #339

This revision is now accepted and ready to land.Sep 30 2025, 11:37 PM

We should also MFC it before the BETA build begins rather than 3 days.

We should also MFC it before the BETA build begins rather than 3 days.

@cperciva are you ok with an insta-MFC? this is the bug that broke the release build in main because ncurses-all.ucl contained the string * "Software".

This revision was automatically updated to reflect the committed changes.