svn commit: r317793 - in stable/11: sys/dev/sound/pcm usr.bin/unexpand
Pedro F. Giffuni
pfg at FreeBSD.org
Thu May 4 14:48:59 UTC 2017
Author: pfg
Date: Thu May 4 14:48:57 2017
New Revision: 317793
URL: https://svnweb.freebsd.org/changeset/base/317793
Log:
MFC r317583:
Fix some cases where an index was used before its limits check.
Obtained from: DragonFlyBSD (git 799ba435)
Modified:
stable/11/sys/dev/sound/pcm/feeder_matrix.c
stable/11/usr.bin/unexpand/unexpand.c
Directory Properties:
stable/11/ (props changed)
Modified: stable/11/sys/dev/sound/pcm/feeder_matrix.c
==============================================================================
--- stable/11/sys/dev/sound/pcm/feeder_matrix.c Thu May 4 14:20:52 2017 (r317792)
+++ stable/11/sys/dev/sound/pcm/feeder_matrix.c Thu May 4 14:48:57 2017 (r317793)
@@ -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/11/usr.bin/unexpand/unexpand.c
==============================================================================
--- stable/11/usr.bin/unexpand/unexpand.c Thu May 4 14:20:52 2017 (r317792)
+++ stable/11/usr.bin/unexpand/unexpand.c Thu May 4 14:48:57 2017 (r317793)
@@ -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');
More information about the svn-src-stable-11
mailing list