Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/dev Bounds checking inside the mixing of the audio block.
details: https://anonhg.NetBSD.org/src/rev/93424a8b3498
branches: trunk
changeset: 353421:93424a8b3498
user: nat <nat%NetBSD.org@localhost>
date: Fri May 05 00:38:50 2017 +0000
description:
Bounds checking inside the mixing of the audio block.
Addresses PR kern/52175.
diffstat:
sys/dev/audio.c | 14 +++++++-------
1 files changed, 7 insertions(+), 7 deletions(-)
diffs (37 lines):
diff -r 85ba3df3826f -r 93424a8b3498 sys/dev/audio.c
--- a/sys/dev/audio.c Thu May 04 19:12:53 2017 +0000
+++ b/sys/dev/audio.c Fri May 05 00:38:50 2017 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: audio.c,v 1.332 2017/05/02 07:25:50 nat Exp $ */
+/* $NetBSD: audio.c,v 1.333 2017/05/05 00:38:50 nat Exp $ */
/*-
* Copyright (c) 2016 Nathanial Sloss <nathanialsloss%yahoo.com.au@localhost>
@@ -148,7 +148,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: audio.c,v 1.332 2017/05/02 07:25:50 nat Exp $");
+__KERNEL_RCSID(0, "$NetBSD: audio.c,v 1.333 2017/05/05 00:38:50 nat Exp $");
#include "audio.h"
#if NAUDIO > 0
@@ -5571,13 +5571,13 @@
else if (orig[m] < 0 && tomix[m] < 0) \
result -= product / MINVAL; \
orig[m] = result; \
+ \
+ if (&orig[m] >= (type *)sc->sc_pr.s.end)\
+ orig = (type *)sc->sc_pr.s.start;\
+ if (&tomix[m] >= (type *)cb->s.end) \
+ tomix = (type *)cb->s.start; \
} \
\
- if (&orig[m] >= (type *)sc->sc_pr.s.end) \
- orig = (type *)sc->sc_pr.s.start; \
- if (&tomix[m] >= (type *)cb->s.end) \
- tomix = (type *)cb->s.start; \
- \
resid -= cc; \
} \
} \
Home |
Main Index |
Thread Index |
Old Index