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)
Sun, Apr 14, 3:28 AM
Unknown Object (File)
Sat, Apr 13, 6:20 AM
Unknown Object (File)
Apr 4 2024, 12:12 PM
Unknown Object (File)
Apr 4 2024, 12:06 PM
Unknown Object (File)
Jan 27 2024, 10:00 PM
Unknown Object (File)
Jan 15 2024, 5:38 PM
Unknown Object (File)
Dec 12 2023, 6:03 AM
Unknown Object (File)
Dec 9 2023, 9:24 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 Not Applicable
Unit
Tests Not Applicable

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