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
Unknown Object (File)
Oct 4 2024, 11:09 AM
Unknown Object (File)
Oct 4 2024, 5:34 AM
Unknown Object (File)
Oct 2 2024, 7:57 AM
Unknown Object (File)
Oct 1 2024, 5:13 PM
Unknown Object (File)
Sep 27 2024, 8:21 AM
Unknown Object (File)
Sep 27 2024, 4:06 AM
Unknown Object (File)
Sep 26 2024, 5:03 PM
Unknown Object (File)
Sep 21 2024, 6:44 AM

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