Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/dev/pci Signedness bug/crash in azalia and hdaudio. Fixe...
details: https://anonhg.NetBSD.org/src/rev/47999ca77c2d
branches: trunk
changeset: 750971:47999ca77c2d
user: tonnerre <tonnerre%NetBSD.org@localhost>
date: Wed Jan 20 09:05:12 2010 +0000
description:
Signedness bug/crash in azalia and hdaudio. Fixes PR 42604.
By Pierre Pronchery.
diffstat:
sys/dev/pci/azalia.c | 6 +++---
sys/dev/pci/hdaudio/hdaudio_afg.c | 6 +++---
2 files changed, 6 insertions(+), 6 deletions(-)
diffs (54 lines):
diff -r a4d27707c382 -r 47999ca77c2d sys/dev/pci/azalia.c
--- a/sys/dev/pci/azalia.c Wed Jan 20 07:33:25 2010 +0000
+++ b/sys/dev/pci/azalia.c Wed Jan 20 09:05:12 2010 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: azalia.c,v 1.71 2010/01/08 19:56:51 dyoung Exp $ */
+/* $NetBSD: azalia.c,v 1.72 2010/01/20 09:05:12 tonnerre Exp $ */
/*-
* Copyright (c) 2005 The NetBSD Foundation, Inc.
@@ -41,7 +41,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: azalia.c,v 1.71 2010/01/08 19:56:51 dyoung Exp $");
+__KERNEL_RCSID(0, "$NetBSD: azalia.c,v 1.72 2010/01/20 09:05:12 tonnerre Exp $");
#include <sys/param.h>
#include <sys/device.h>
@@ -2238,7 +2238,7 @@
az = v;
co = &az->codecs[az->codecno];
- if (mdev->index >= co->nmixers)
+ if (mdev->index < 0 || mdev->index >= co->nmixers)
return ENXIO;
*mdev = co->mixers[mdev->index].devinfo;
return 0;
diff -r a4d27707c382 -r 47999ca77c2d sys/dev/pci/hdaudio/hdaudio_afg.c
--- a/sys/dev/pci/hdaudio/hdaudio_afg.c Wed Jan 20 07:33:25 2010 +0000
+++ b/sys/dev/pci/hdaudio/hdaudio_afg.c Wed Jan 20 09:05:12 2010 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: hdaudio_afg.c,v 1.18 2010/01/08 19:56:52 dyoung Exp $ */
+/* $NetBSD: hdaudio_afg.c,v 1.19 2010/01/20 09:05:12 tonnerre Exp $ */
/*
* Copyright (c) 2009 Precedence Technologies Ltd <support%precedence.co.uk@localhost>
@@ -60,7 +60,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: hdaudio_afg.c,v 1.18 2010/01/08 19:56:52 dyoung Exp $");
+__KERNEL_RCSID(0, "$NetBSD: hdaudio_afg.c,v 1.19 2010/01/20 09:05:12 tonnerre Exp $");
#include <sys/types.h>
#include <sys/param.h>
@@ -3500,7 +3500,7 @@
struct hdaudio_audiodev *ad = opaque;
struct hdaudio_afg_softc *sc = ad->ad_sc;
- if (di->index >= sc->sc_nmixers)
+ if (di->index < 0 || di->index >= sc->sc_nmixers)
return ENXIO;
*di = sc->sc_mixers[di->index].mx_di;
Home |
Main Index |
Thread Index |
Old Index