From owner-cvs-all@FreeBSD.ORG Fri Mar 18 15:16:10 2005 Return-Path: Delivered-To: cvs-all@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 59E6616A4CE; Fri, 18 Mar 2005 15:16:10 +0000 (GMT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 41A8043D46; Fri, 18 Mar 2005 15:16:10 +0000 (GMT) (envelope-from harti@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.1/8.13.1) with ESMTP id j2IFGAZC008555; Fri, 18 Mar 2005 15:16:10 GMT (envelope-from harti@repoman.freebsd.org) Received: (from harti@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id j2IFGARw008554; Fri, 18 Mar 2005 15:16:10 GMT (envelope-from harti) Message-Id: <200503181516.j2IFGARw008554@repoman.freebsd.org> From: Hartmut Brandt Date: Fri, 18 Mar 2005 15:16:09 +0000 (UTC) To: src-committers@FreeBSD.org, cvs-src@FreeBSD.org, cvs-all@FreeBSD.org X-FreeBSD-CVS-Branch: HEAD Subject: cvs commit: src/usr.bin/make suff.c X-BeenThere: cvs-all@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: CVS commit messages for the entire tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Mar 2005 15:16:10 -0000 harti 2005-03-18 15:16:09 UTC FreeBSD src repository Modified files: usr.bin/make suff.c Log: 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 me). Submitted by: Matt Dillon (in principle) Revision Changes Path 1.57 +25 -44 src/usr.bin/make/suff.c