Page MenuHomeFreeBSD

regcomp: use unsigned char when testing for escapes
ClosedPublic

Authored by yuripv on Sep 23 2023, 9:54 AM.
Tags
None
Referenced Files
F133261378: D41947.id.diff
Fri, Oct 24, 10:48 AM
F133211360: D41947.id127808.diff
Fri, Oct 24, 12:30 AM
F133209116: D41947.id127669.diff
Fri, Oct 24, 12:00 AM
F133208883: D41947.id127809.diff
Thu, Oct 23, 11:57 PM
F133201787: D41947.id127809.diff
Thu, Oct 23, 10:25 PM
F133193074: D41947.id127669.diff
Thu, Oct 23, 8:31 PM
F133181946: D41947.diff
Thu, Oct 23, 6:12 PM
F133181151: D41947.diff
Thu, Oct 23, 6:02 PM

Details

Summary
  • cast GETNEXT to unsigned where it is being promoted to int to prevent sign-extension (really it would have been better for PEEK*() and GETNEXT() to return unsigned char; this would have removed a ton of (uch) casts, but it is too intrusive for now).
  • fix an isalpha that should have been iswalpha

PR: 264275, 274032
Obtained from: NetBSD

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

This revision is now accepted and ready to land.Sep 23 2023, 12:21 PM
freebsd_igalic.co added inline comments.
lib/libc/regex/regcomp.c
831

why doesn't GETNEXT() produce uch to begin with?

lib/libc/regex/regcomp.c
831

You could probably try to change it and see what breaks :)

yuripv edited the summary of this revision. (Show Details)

Apparently NetBSD has a bit more complete fix for this (thanks Kyle), use it instead.

This revision now requires review to proceed.Sep 25 2023, 10:18 PM
This revision is now accepted and ready to land.Sep 25 2023, 10:45 PM