From nobody@FreeBSD.org  Sat Jul 27 16:20:06 2002
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.FreeBSD.org (mx1.FreeBSD.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id AC47E37B400
	for <freebsd-gnats-submit@FreeBSD.org>; Sat, 27 Jul 2002 16:20:06 -0700 (PDT)
Received: from www.freebsd.org (www.FreeBSD.org [216.136.204.117])
	by mx1.FreeBSD.org (Postfix) with ESMTP id 0916543E4A
	for <freebsd-gnats-submit@FreeBSD.org>; Sat, 27 Jul 2002 16:20:06 -0700 (PDT)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (localhost [127.0.0.1])
	by www.freebsd.org (8.12.4/8.12.4) with ESMTP id g6RNK5OT057816
	for <freebsd-gnats-submit@FreeBSD.org>; Sat, 27 Jul 2002 16:20:05 -0700 (PDT)
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.12.4/8.12.4/Submit) id g6RNK5ix057815;
	Sat, 27 Jul 2002 16:20:05 -0700 (PDT)
Message-Id: <200207272320.g6RNK5ix057815@www.freebsd.org>
Date: Sat, 27 Jul 2002 16:20:05 -0700 (PDT)
From: "M.J.Kouache" <bsdmail@rhoda.fsworld.co.uk>
To: freebsd-gnats-submit@FreeBSD.org
Subject: Typo
X-Send-Pr-Version: www-1.0

>Number:         41063
>Category:       kern
>Synopsis:       Typo
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    sos
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sat Jul 27 16:30:01 PDT 2002
>Closed-Date:    Mon Aug 19 11:59:57 PDT 2002
>Last-Modified:  Mon Aug 19 11:59:57 PDT 2002
>Originator:     M.J.Kouache
>Release:        MAIN & RELENG_4
>Organization:
>Environment:
unimportant
>Description:
 There's a nasty typo in sys/dev/ata/atapi-all.c.
 First look at the diff -c I have submitted as the fix,
 especially notice that the buffer size has been increased.
 If I really need to explain more, then read on,
 (if not, goodbye and thanks for your time :-)

Version 1.10 of atapi-all.c in the MAIN source branch included a change in the error message, the new one is longer than the original and is now too large for the allocated buffer. This was introduced 3 years ago, and no-one's noticed yet, hence the non-critical severity of this pr.
 At least this bug isn't as bad as the evil "<<" where it should be ">>" typo in the ata 48 bit addressing code, the fix to which has still not appeared in 4-STABLE yet btw.

>How-To-Repeat:
      
>Fix:
      *** atapi-all.c	Sat Jul 27 21:51:17 2002
--- atapi-all.fixed.c	Sat Jul 27 21:51:57 2002
***************
*** 35,41 ****
      case 0xbd: return ("MECH_STATUS");
      case 0xbe: return ("READ_CD");
      default: {
! 	static int8_t buffer[16];
  	sprintf(buffer, "unknown CMD (0x%02x)", cmd);
  	return buffer;
  	}
--- 35,41 ----
      case 0xbd: return ("MECH_STATUS");
      case 0xbe: return ("READ_CD");
      default: {
! 	static int8_t buffer[20];
  	sprintf(buffer, "unknown CMD (0x%02x)", cmd);
  	return buffer;
  	}

>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->sos 
Responsible-Changed-By: dwmalone 
Responsible-Changed-When: Sun Jul 28 06:23:10 PDT 2002 
Responsible-Changed-Why:  
Soren - this is a simple fix for a undersized string buffer. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=41063 
State-Changed-From-To: open->closed 
State-Changed-By: sos 
State-Changed-When: Mon Aug 19 11:48:46 PDT 2002 
State-Changed-Why:  

Fixed, now the reason its not "fatal" is that all possible cmds are 
already in the table. 

About the 48bit << vs >> bug, its of no significance at all in 
-stable, since block numbers are only 32 bits from the kernel. 

But its a typo and I've just fixed it :) 


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