Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/usr.bin/mixerctl Avoid SEGV even if audio device has no mixe...



details:   https://anonhg.NetBSD.org/src/rev/75c229c3ec7c
branches:  trunk
changeset: 782319:75c229c3ec7c
user:      isaki <isaki%NetBSD.org@localhost>
date:      Sun Oct 28 01:51:20 2012 +0000

description:
Avoid SEGV even if audio device has no mixer features.
Fix PR/47003

diffstat:

 usr.bin/mixerctl/mixerctl.c |  6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diffs (27 lines):

diff -r 77a724ca7e04 -r 75c229c3ec7c usr.bin/mixerctl/mixerctl.c
--- a/usr.bin/mixerctl/mixerctl.c       Sun Oct 28 00:25:59 2012 +0000
+++ b/usr.bin/mixerctl/mixerctl.c       Sun Oct 28 01:51:20 2012 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: mixerctl.c,v 1.24 2009/07/14 21:02:24 apb Exp $        */
+/*     $NetBSD: mixerctl.c,v 1.25 2012/10/28 01:51:20 isaki Exp $      */
 
 /*
  * Copyright (c) 1997 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
 #include <sys/cdefs.h>
 
 #ifndef lint
-__RCSID("$NetBSD: mixerctl.c,v 1.24 2009/07/14 21:02:24 apb Exp $");
+__RCSID("$NetBSD: mixerctl.c,v 1.25 2012/10/28 01:51:20 isaki Exp $");
 #endif
 
 #include <stdio.h>
@@ -429,7 +429,7 @@
        }
 
        if (argc == 0 && aflag && !wflag) {
-               for(i = 0; fields[i].name; i++) {
+               for(i = 0; i < j; i++) {
                        prfield(&fields[i], sep, vflag);
                        fprintf(out, "\n");
                }



Home | Main Index | Thread Index | Old Index