HomeFreeBSD

MFC r287148: sh: Fix out of bounds read when there is no ] after a [:class:].

Description

MFC r287148: sh: Fix out of bounds read when there is no ] after a [:class:].

The initial check for a matching ] was incorrect if a ] may be consumed by a
[:class:]. The subsequent loop assumed that there must be a ].

Remove the initial check and make the loop cope with a missing ].

Found with afl-fuzz.

Details

Provenance
jillesAuthored on
Parents
rS287751: MFC r278826,279330: sh: Various cleanups to expand.c:
Branches
Unknown
Tags
Unknown