From owner-cvs-all Sat Apr 6 18:30: 2 2002 Delivered-To: cvs-all@freebsd.org Received: from freefall.freebsd.org (freefall.FreeBSD.org [216.136.204.21]) by hub.freebsd.org (Postfix) with ESMTP id E983137B405; Sat, 6 Apr 2002 18:29:56 -0800 (PST) Received: (from jmallett@localhost) by freefall.freebsd.org (8.11.6/8.11.6) id g372Tui51878; Sat, 6 Apr 2002 18:29:56 -0800 (PST) (envelope-from jmallett) Message-Id: <200204070229.g372Tui51878@freefall.freebsd.org> From: "J. Mallett" Date: Sat, 6 Apr 2002 18:29:56 -0800 (PST) To: cvs-committers@FreeBSD.org, cvs-all@FreeBSD.org Subject: cvs commit: src/usr.bin/sed process.c X-FreeBSD-CVS-Branch: HEAD Sender: owner-cvs-all@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG jmallett 2002/04/06 18:29:56 PST Modified files: usr.bin/sed process.c Log: Fix sed(1) in the case where a last line is specified and hold space is not specified, and then the first part of the pattern space is deleted, when there are two or more input lines, as this results in subtraction of one from an unsigned integral value of '0'. That bogus value is used in one case for a loop (that will run far too many times in this case) and a function to search for a value within a specified range of memory, however now the range of memory is obscenely large and a segmentation fault will occur. This is fixed by checking for and appropriately handling a nil pattern space as if the specified search in memory failed, as indeed it obviously will with nil pattern space. Submitted by: Tim J. Robbins PR: bin/34813 Reviewed by: mike MFC after: 1 day Revision Changes Path 1.15 +5 -3 src/usr.bin/sed/process.c To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe cvs-all" in the body of the message