Page MenuHomeFreeBSD

Fix multiple bugs in cam_strmatch
ClosedPublic

Authored by asomers on Nov 20 2017, 9:41 PM.
Tags
None
Referenced Files
F167447107: D13173.id35507.diff
Fri, Aug 21, 8:01 PM
F167446934: D13173.diff
Fri, Aug 21, 7:58 PM
F167395054: D13173.diff
Fri, Aug 21, 12:59 PM
Unknown Object (File)
Thu, Aug 20, 6:56 PM
Unknown Object (File)
Thu, Aug 13, 11:27 AM
Unknown Object (File)
Wed, Aug 12, 7:15 PM
Unknown Object (File)
Mon, Aug 10, 6:05 AM
Unknown Object (File)
Fri, Aug 7, 10:19 AM
Subscribers

Details

Summary

Fix multiple bugs in cam_strmatch

  • Wrongly matches strings that are shorter than the pattern
  • Fails to match negative character sets
  • Fails to match character sets that aren't at the end of the pattern
  • Fails to match character ranges
Test Plan

Added unit tests

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 12891
Build 13153: arc lint + arc unit

Event Timeline

I suspect these same bugs are present in the file globbing code I stole the original implementation from.
Nice catches.

lib/libcam/tests/cam_test.c
91

There's no pattern like 'fo[a-z][a-z][123]' which has multiple ranges tested.

This revision is now accepted and ready to land.Nov 20 2017, 9:46 PM
lib/libcam/tests/cam_test.c
91

Ok, I'll add one.

This revision was automatically updated to reflect the committed changes.