HomeFreeBSD

lib/libc/amd64/string/strcspn.S: fix behaviour with sets of 17--32

Description

lib/libc/amd64/string/strcspn.S: fix behaviour with sets of 17--32

When a string is matched against a set of 17--32 characters, each chunk
of the string is matched first against the first 16 characters of the
set and then against the remaining characters. We also check at the
same time if the string has a nul byte in the current chunk, terminating
the search if it does.

Due to misconceived logic, the order of checks was "first half of set,
nul byte, second half of set", meaning that a match with the second half
of the set was ignored when the string ended in the same 16 bytes.
Reverse the order of checks to fix this problem.

Sponsored by: The FreeBSD Foundation
Approved by: mjg (blanket, via IRC)
MFC after: 1 week
MFC to: stable/14

Details

Provenance
fuzAuthored on Sep 11 2023, 11:56 PM
Parents
rGfafb03ab4254: siftr: flush pkt_nodes to the log file in batch
Branches
Unknown
Tags
Unknown