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
F170618641: D52808.id163146.diff
Sat, Sep 5, 4:20 PM
Unknown Object (File)
Fri, Sep 4, 9:22 AM
Unknown Object (File)
Thu, Sep 3, 3:06 PM
Unknown Object (File)
Wed, Sep 2, 9:35 AM
Unknown Object (File)
Wed, Sep 2, 8:41 AM
Unknown Object (File)
Tue, Sep 1, 1:25 PM
Unknown Object (File)
Mon, Aug 31, 8:24 AM
Unknown Object (File)
Sun, Aug 30, 11:43 AM
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 Skipped
Unit
Tests Skipped
Build Status
Buildable 67425
Build 64308: arc lint + arc unit

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.