rpms/pcmciautils/F-12 pcmciautils-func_id.patch, NONE, 1.1 pcmciautils.spec, 1.34, 1.35

Harald Hoyer harald at fedoraproject.org
Fri Apr 9 08:52:32 UTC 2010


Author: harald

Update of /cvs/pkgs/rpms/pcmciautils/F-12
In directory cvs01.phx2.fedoraproject.org:/tmp/cvs-serv32567

Modified Files:
	pcmciautils.spec 
Added Files:
	pcmciautils-func_id.patch 
Log Message:
* Fri Apr 09 2010 Harald Hoyer <harald at redhat.com> 015-5
- check if func_id index fits in fn table (bug #580652)


pcmciautils-func_id.patch:
 pccardctl.c |    8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

--- NEW FILE pcmciautils-func_id.patch ---
commit acc8c350f9cf6779ed1b5d37aaa904cd720fa1df
Author: Dominik Brodowski <linux at dominikbrodowski.net>
Date:   Sun Aug 2 14:04:59 2009 +0200

    pccardctl: add array out-of-bounds exception (2)
    
    Fix another instance where an array out-of-bounds exception relating to
    func_id was triggered. Spotted at[1], still pending bugfix noted by
    Wolfram Sang.
    
    [1] http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=406251
    
    Signed-off-by: Dominik Brodowski <linux at dominikbrodowski.net>

diff --git a/src/pccardctl.c b/src/pccardctl.c
index d3d3317..d5cbfef 100644
--- a/src/pccardctl.c
+++ b/src/pccardctl.c
@@ -589,8 +589,12 @@ static int lspcmcia(unsigned long socket_no, int verbose)
 			if (!pccardctl_get_one(socket_no, "manf_id", &manf_id))
 				if (!pccardctl_get_one(socket_no, "card_id", &card_id))
 					printf("manf_id: 0x%04x\tcard_id: 0x%04x\n\t\t\t", manf_id, card_id);
-			if (!pccardctl_get_one(socket_no, "func_id", &manf_id))
-				printf("function: %d (%s)\n\t\t\t", manf_id, fn[manf_id]);
+			if (!pccardctl_get_one(socket_no, "func_id", &manf_id)) {
+				const char *s = "unknown";
+				if (manf_id < sizeof(fn)/sizeof(*fn))
+					s = fn[manf_id];
+				printf("function: %d (%s)\n\t\t\t", manf_id, s);
+			}
 			for (j=1;j<=4;j++) {
 				snprintf(file, SYSFS_PATH_MAX, "prod_id%d", j);
 				pccardctl_get_string(socket_no, file, &res);


Index: pcmciautils.spec
===================================================================
RCS file: /cvs/pkgs/rpms/pcmciautils/F-12/pcmciautils.spec,v
retrieving revision 1.34
retrieving revision 1.35
diff -u -p -r1.34 -r1.35
--- pcmciautils.spec	6 Aug 2009 10:36:18 -0000	1.34
+++ pcmciautils.spec	9 Apr 2010 08:52:32 -0000	1.35
@@ -2,7 +2,7 @@ Name: pcmciautils
 Summary: PCMCIA utilities and initialization programs
 License: GPLv2
 Version: 015
-Release: 4%{?dist}
+Release: 5%{?dist}
 Group: System Environment/Base
 ExclusiveArch: i386 i586 i686 x86_64 ia64 ppc ppc64 %{?arm}
 URL: http://www.kernel.org/pub/linux/utils/kernel/pcmcia/pcmcia.html
@@ -17,6 +17,7 @@ BuildRequires: libsysfs-devel >= 1.3.0
 Requires: udev >= 062, kernel >= 2.6.12-1.1411_FC5
 BuildRequires: byacc, flex
 Patch1: pcmciautils-fedora.patch
+Patch2: pcmciautils-func_id.patch
 
 %description
 The pcmciautils package contains utilities for initializing and
@@ -26,6 +27,7 @@ debugging PCMCIA and Cardbus sockets.
 %setup -q
 # Fix build peculiarities
 %patch1 -p1
+%patch2 -p1
 
 %build
 make %{?_smp_mflags}
@@ -54,6 +56,9 @@ mv $RPM_BUILD_ROOT/sbin/pcmcia-socket-st
 %{_mandir}/man*/pccardctl*
 
 %changelog
+* Fri Apr 09 2010 Harald Hoyer <harald at redhat.com> 015-5
+- check if func_id index fits in fn table (bug #580652)
+
 * Thu Aug 06 2009 Harald Hoyer <harald at redhat.com> 015-4
 - add i686 buildarch
 



More information about the scm-commits mailing list