From nobody@FreeBSD.org  Tue Mar 31 12:00:51 2009
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 3B67E106567A
	for <freebsd-gnats-submit@FreeBSD.org>; Tue, 31 Mar 2009 12:00:51 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (www.freebsd.org [IPv6:2001:4f8:fff6::21])
	by mx1.freebsd.org (Postfix) with ESMTP id 29B798FC29
	for <freebsd-gnats-submit@FreeBSD.org>; Tue, 31 Mar 2009 12:00:51 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (localhost [127.0.0.1])
	by www.freebsd.org (8.14.3/8.14.3) with ESMTP id n2VC0oPU051905
	for <freebsd-gnats-submit@FreeBSD.org>; Tue, 31 Mar 2009 12:00:50 GMT
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.14.3/8.14.3/Submit) id n2VC0oeZ051904;
	Tue, 31 Mar 2009 12:00:50 GMT
	(envelope-from nobody)
Message-Id: <200903311200.n2VC0oeZ051904@www.freebsd.org>
Date: Tue, 31 Mar 2009 12:00:50 GMT
From: Bruce Cran <bruce@cran.org.uk>
To: freebsd-gnats-submit@FreeBSD.org
Subject: [boot] off-by-one error in gets.c causes panic when input buffer is filled
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         133240
>Category:       kern
>Synopsis:       [boot] off-by-one error in gets.c causes panic when input buffer is filled
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Tue Mar 31 12:10:01 UTC 2009
>Closed-Date:    Sun Feb 28 22:30:32 UTC 2010
>Last-Modified:  Sun Feb 28 22:30:32 UTC 2010
>Originator:     Bruce Cran
>Release:        7-STABLE
>Organization:
>Environment:
8-CURRENT and 7-STABLE
>Description:
If the input buffer at the loader prompt (OK) is filled until no more characters can be entered then a panic occurs when the enter key is pressed due to an off-by-one error in src/lib/libstand/gets.c.   Line 77 of gets.c should be comparing (lp-buf) against (n-1) instead of n.

>How-To-Repeat:
At the loader (OK) prompt, enter "boot " followed by as many characters as possible until they stop being accepted. Press Enter.
>Fix:
Line 77 of src/lib/libstand/gets.c should be comparing (lp-buf) against (n-1) instead of n.


>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->patched  
State-Changed-By: brucec 
State-Changed-When: Tue Mar 31 17:04:39 UTC 2009 
State-Changed-Why:  
Fixed in -current. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=133240 
State-Changed-From-To: patched->closed  
State-Changed-By: brucec 
State-Changed-When: Sun Feb 28 22:29:29 UTC 2010 
State-Changed-Why:  
Patch has been committed to stable/6 and stable/7. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=133240 
>Unformatted:
