rpms/pcmciautils/devel pcmciautils-014-funcname.patch, NONE, 1.1 pcmciautils.spec, 1.24, 1.25

Harald Hoyer (harald) fedora-extras-commits at redhat.com
Wed Jun 6 10:49:24 UTC 2007


Author: harald

Update of /cvs/pkgs/rpms/pcmciautils/devel
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv16414

Modified Files:
	pcmciautils.spec 
Added Files:
	pcmciautils-014-funcname.patch 
Log Message:
- fixed 'pccardctl ident' SEGV
- Resolves: rhbz#242805


pcmciautils-014-funcname.patch:

--- NEW FILE pcmciautils-014-funcname.patch ---
--- pcmciautils-014/src/pccardctl.c~	2006-06-01 10:07:52.000000000 +0100
+++ pcmciautils-014/src/pccardctl.c	2007-06-05 22:20:36.000000000 +0100
@@ -37,6 +37,7 @@ static char *fn[] = {
 	"AIMS",
 	"SCSI"
 };
+#define NR_FNS ( sizeof(fn) / sizeof(*fn) )
 
 /* crc32hash.c - derived from linux/lib/crc32.c, GNU GPL v2 */
 static unsigned int crc32(unsigned char const *p, unsigned int len)
@@ -219,7 +220,7 @@ static int pccardctl_ident(unsigned long
 	char *prod_id[4];
 	int valid_prod_id = 0;
 	int i;
-	unsigned int manf_id, card_id;
+	unsigned int manf_id, card_id, func_id;
 
 	if (!pccardctl_socket_exists(socket_no))
 		return -ENODEV;
@@ -249,9 +250,15 @@ static int pccardctl_ident(unsigned long
 		if (!pccardctl_get_one(socket_no, "card_id", &card_id))
 			printf("  manfid: 0x%04x, 0x%04x\n", manf_id, card_id);
 
-	if (!pccardctl_get_one(socket_no, "func_id", &manf_id))
-		printf("  function: %d (%s)\n", manf_id, fn[manf_id]);
+	if (!pccardctl_get_one(socket_no, "func_id", &func_id)) {
+		char *func_name;
+		if (func_id < NR_FNS)
+			func_name = fn[func_id];
+		else
+			func_name = "unknown";
 
+		printf("  function: 0x%x (%s), %d\n", func_id, func_name, NR_FNS);
+	}
 
 	return 0;
 }


Index: pcmciautils.spec
===================================================================
RCS file: /cvs/pkgs/rpms/pcmciautils/devel/pcmciautils.spec,v
retrieving revision 1.24
retrieving revision 1.25
diff -u -r1.24 -r1.25
--- pcmciautils.spec	2 Apr 2007 10:01:56 -0000	1.24
+++ pcmciautils.spec	6 Jun 2007 10:48:33 -0000	1.25
@@ -2,7 +2,7 @@
 Summary: PCMCIA utilities and initialization programs
 License: GPL
 Version: 014
-Release: 7%{?dist}
+Release: 8%{?dist}
 Group: System Environment/Base
 ExclusiveArch: i386 x86_64 ia64 ppc ppc64
 URL: http://www.kernel.org/pub/linux/utils/kernel/pcmcia/pcmcia.html
@@ -18,6 +18,7 @@
 BuildRequires: byacc, flex
 Patch1: pcmciautils-fedora.patch
 Patch2: pcmciautils-014-newrules.patch
+Patch3: pcmciautils-014-funcname.patch
 
 %description
 The pcmciautils package contains utilities for initializing and
@@ -28,6 +29,7 @@
 # Fix build peculiarities
 %patch1 -p1
 %patch2 -p1
+%patch3 -p1
 
 %build
 make %{?_smp_mflags}
@@ -52,6 +54,10 @@
 %{_mandir}/man*/pccardctl*
 
 %changelog
+* Wed Jun  6 2007 Harald Hoyer <harald at redhat.com> - 014-8
+- fixed 'pccardctl ident' SEGV
+- Resolves: rhbz#242805
+
 * Mon Apr  2 2007 Harald Hoyer <harald at redhat.com> - 014-7
 - removed Provides, because it would conflict (#234504)
 - Resolves: rhbz#234504




More information about the fedora-extras-commits mailing list