Patch originally from Matt, then modified by harti.
authorMax Okumoto <okumoto@dragonflybsd.org>
Fri, 18 Mar 2005 18:21:10 +0000 (18:21 +0000)
committerMax Okumoto <okumoto@dragonflybsd.org>
Fri, 18 Mar 2005 18:21:10 +0000 (18:21 +0000)
commitece15f5261d3bcfc89486bb9ffdd6c49aec8f200
tree2164a2d734b7fe2d8dae47a53349c3e940f30167
parent8c4612fd7805208ec358b9afba818812b8df8389
Patch originally from Matt, then modified by harti.

FreeBSD-Date: 2005/03/18 15:16:09
Author: matt, harti

Fix a bug in matching suffixes. Under certain circumstances the code
would access memory before the beginning of the string to match (the
suffix match starts at the end of both the string and the suffix and
proceedes to the begin until either the start of the suffix is hit
or the character does not match). This could lead to a memcpy copying
into random memory. Fix this by checking the length of the string to
match too and replacing the Lst_Find calls with LST_FOREACH loops
(last part by harti).
usr.bin/make/suff.c