From owner-svn-src-stable@freebsd.org Thu May 4 14:50:27 2017 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 267D9D5DBA3; Thu, 4 May 2017 14:50:27 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CCF30E34; Thu, 4 May 2017 14:50:26 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v44EoPBx007523; Thu, 4 May 2017 14:50:25 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v44EoPKi007521; Thu, 4 May 2017 14:50:25 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201705041450.v44EoPKi007521@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Thu, 4 May 2017 14:50:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r317794 - in stable/10: sys/dev/sound/pcm usr.bin/unexpand X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 May 2017 14:50:27 -0000 Author: pfg Date: Thu May 4 14:50:25 2017 New Revision: 317794 URL: https://svnweb.freebsd.org/changeset/base/317794 Log: MFC r317583: Fix some cases where an index was used before its limits check. Obtained from: DragonFlyBSD (git 799ba435) Modified: stable/10/sys/dev/sound/pcm/feeder_matrix.c stable/10/usr.bin/unexpand/unexpand.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/sound/pcm/feeder_matrix.c ============================================================================== --- stable/10/sys/dev/sound/pcm/feeder_matrix.c Thu May 4 14:48:57 2017 (r317793) +++ stable/10/sys/dev/sound/pcm/feeder_matrix.c Thu May 4 14:50:25 2017 (r317794) @@ -750,8 +750,8 @@ feeder_matrix_oss_get_channel_order(stru tmpmap = 0x0000000000000000ULL; - for (i = 0; m->map[i].type != SND_CHN_T_MAX && - i < SND_CHN_OSS_MAX; i++) { + for (i = 0; i < SND_CHN_OSS_MAX && m->map[i].type != SND_CHN_T_MAX; + i++) { if ((1 << m->map[i].type) & ~SND_CHN_OSS_VALIDMASK) return (EINVAL); tmpmap |= Modified: stable/10/usr.bin/unexpand/unexpand.c ============================================================================== --- stable/10/usr.bin/unexpand/unexpand.c Thu May 4 14:48:57 2017 (r317793) +++ stable/10/usr.bin/unexpand/unexpand.c Thu May 4 14:50:25 2017 (r317794) @@ -132,8 +132,8 @@ tabify(const char *curfile) tabstops[0]; continue; } else { - for (n = 0; tabstops[n] - 1 < dcol && - n < nstops; n++) + for (n = 0; n < nstops && + tabstops[n] - 1 < dcol; n++) ; if (n < nstops - 1 && tabstops[n] - 1 < limit) { dcol = tabstops[n]; @@ -154,7 +154,7 @@ tabify(const char *curfile) tabstops[0]; } } else { - for (n = 0; tabstops[n] - 1 < ocol && n < nstops; n++) + for (n = 0; n < nstops && tabstops[n] - 1 < ocol; n++) ; while (ocol < dcol && n < nstops && ocol < limit) { putwchar('\t');