]> CyberLeo.Net >> Repos - FreeBSD/stable/10.git/commit
MFC r287148: sh: Fix out of bounds read when there is no ] after a [:class:].
authorjilles <jilles@ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f>
Sun, 13 Sep 2015 13:58:46 +0000 (13:58 +0000)
committerjilles <jilles@ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f>
Sun, 13 Sep 2015 13:58:46 +0000 (13:58 +0000)
commitade37d37ffc450b5b2a94bd475f8a1a07edd10b8
treefd23eeaf39e5fc47af49dbefaf2a9ee7712c07ed
parent1cd11480a9baa905a12fc42aa405da44ec948b85
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.

git-svn-id: svn://svn.freebsd.org/base/stable/10@287752 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
bin/sh/expand.c
bin/sh/tests/builtins/Makefile
bin/sh/tests/builtins/case20.0 [new file with mode: 0644]