NetBSD Problem Report #52135

From www@NetBSD.org  Mon Apr  3 16:45:59 2017
Return-Path: <www@NetBSD.org>
Received: from mail.netbsd.org (mail.netbsd.org [199.233.217.200])
	(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
	(Client CN "mail.netbsd.org", Issuer "Postmaster NetBSD.org" (verified OK))
	by mollari.NetBSD.org (Postfix) with ESMTPS id 152237A234
	for <gnats-bugs@gnats.NetBSD.org>; Mon,  3 Apr 2017 16:45:59 +0000 (UTC)
Message-Id: <20170403164558.398D67A2AE@mollari.NetBSD.org>
Date: Mon,  3 Apr 2017 16:45:58 +0000 (UTC)
From: dcb314@hotmail.com
Reply-To: dcb314@hotmail.com
To: gnats-bugs@NetBSD.org
Subject: sys/arch/x68k/x68k/machdep.c:696: poor location for limits check ?
X-Send-Pr-Version: www-1.0

>Number:         52135
>Category:       port-x68k
>Synopsis:       sys/arch/x68k/x68k/machdep.c:696: poor location for limits check ?
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    port-x68k-maintainer
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon Apr 03 16:50:00 +0000 2017
>Closed-Date:    Mon Apr 03 19:04:14 +0000 2017
>Last-Modified:  Mon Apr 03 19:04:14 +0000 2017
>Originator:     David Binderman
>Release:        cvs-20170403
>Organization:
>Environment:
>Description:
sys/arch/x68k/x68k/machdep.c:696]: (style) Array index 'i' is used before limits check.

Source code is

    for (i = 0; m->ram_segs[i].size && i < M68K_NPHYS_RAM_SEGS; i++)

>How-To-Repeat:

>Fix:

>Release-Note:

>Audit-Trail:
From: "Christos Zoulas" <christos@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/52135 CVS commit: src/sys/arch/x68k/x68k
Date: Mon, 3 Apr 2017 13:37:29 -0400

 Module Name:	src
 Committed By:	christos
 Date:		Mon Apr  3 17:37:29 UTC 2017

 Modified Files:
 	src/sys/arch/x68k/x68k: machdep.c

 Log Message:
 PR/52135: David Binderman: Fix loop bounds checking.


 To generate a diff of this commit:
 cvs rdiff -u -r1.195 -r1.196 src/sys/arch/x68k/x68k/machdep.c

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

State-Changed-From-To: open->closed
State-Changed-By: leot@NetBSD.org
State-Changed-When: Mon, 03 Apr 2017 19:04:14 +0000
State-Changed-Why:
Fixed by <christos>.
Thank you David for the PR and thanks Christos for fixing it!


>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD: gnats_config.sh,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2014 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.