Page MenuHomeFreeBSD

libucl: Fix bugs in C-style comment parser
ClosedPublic

Authored by des on Tue, Sep 30, 8:52 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sat, Oct 11, 10:41 PM
Unknown Object (File)
Fri, Oct 10, 3:23 PM
Unknown Object (File)
Thu, Oct 9, 1:54 PM
Unknown Object (File)
Thu, Oct 9, 1:54 PM
Unknown Object (File)
Thu, Oct 9, 1:54 PM
Unknown Object (File)
Thu, Oct 9, 12:57 PM
Unknown Object (File)
Wed, Oct 1, 10:12 PM
Unknown Object (File)
Wed, Oct 1, 4:14 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.Tue, Sep 30, 8:52 PM

This has also been submitted upstream as #339

This revision is now accepted and ready to land.Tue, Sep 30, 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.