Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 22 Nov 2008 14:48:40 +0000 (UTC)
From:      Alexander Motin <mav@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r185176 - head/sys/dev/sound/pci/hda
Message-ID:  <200811221448.mAMEmeif020552@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: mav
Date: Sat Nov 22 14:48:40 2008
New Revision: 185176
URL: http://svn.freebsd.org/changeset/base/185176

Log:
  Change check order to avoid array overrun.
  
  Found with:	Coverity Prevent(tm)
  CID:		2497

Modified:
  head/sys/dev/sound/pci/hda/hdac.c

Modified: head/sys/dev/sound/pci/hda/hdac.c
==============================================================================
--- head/sys/dev/sound/pci/hda/hdac.c	Sat Nov 22 14:24:55 2008	(r185175)
+++ head/sys/dev/sound/pci/hda/hdac.c	Sat Nov 22 14:48:40 2008	(r185176)
@@ -83,7 +83,7 @@
 
 #include "mixer_if.h"
 
-#define HDA_DRV_TEST_REV	"20081115_0116"
+#define HDA_DRV_TEST_REV	"20081122_0117"
 
 SND_DECLARE_FILE("$FreeBSD$");
 
@@ -4762,7 +4762,7 @@ hdac_audio_trace_as_out(struct hdac_devi
 	nid_t min, res;
 
 	/* Find next pin */
-	for (i = seq; ases[as].pins[i] == 0 && i < 16; i++)
+	for (i = seq; i < 16 && ases[as].pins[i] == 0; i++)
 		;
 	/* Check if there is no any left. If so - we succeded. */
 	if (i == 16)



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200811221448.mAMEmeif020552>