Package: pcmciautils
Version: 014-3
Severity: normal
Tags: patch

Hi,

# lspcmcia -v
Socket 0 Bridge:        [yenta_cardbus]         (bus ID: 0000:02:03.0)
        Configuration:  state: on       ready: yes
                        Voltage: 3.3V Vcc: 3.3V Vpp: 3.3V
Socket 0 Device 0:      [-- no driver --]       (bus ID: 0.0)
        Configuration:  state: on
        Product Name:   RICOH Bay1Controller 
        Identification: manf_id: 0x0000 card_id: 0x0000
Segmentation fault.

This is because the device reports function 254, which is out of the fn
array, see attached fix.

Samuel

-- System Information:
Debian Release: 4.0
  APT prefers testing
  APT policy: (990, 'testing'), (500, 'unstable'), (500, 'stable'), (1, 
'experimental')
Architecture: i386 (i686)
Shell:  /bin/sh linked to /bin/bash
Kernel: Linux 2.6.19
Locale: [EMAIL PROTECTED], [EMAIL PROTECTED] (charmap=ISO-8859-15)

Versions of packages pcmciautils depends on:
ii  libc6                        2.3.6.ds1-8 GNU C Library: Shared libraries
ii  libsysfs2                    2.1.0-1     interface library to sysfs
ii  lsb-base                     3.1-22      Linux Standard Base 3.1 init scrip
ii  module-init-tools            3.3-pre3-1  tools for managing Linux kernel mo

Versions of packages pcmciautils recommends:
ii  udev                          0.103-1    /dev/ and hotplug management daemo

-- no debconf information

-- 
Samuel Thibault <[EMAIL PROTECTED]>
We are Pentium of Borg. Division is futile. You will be approximated.
(seen in someone's .signature)
diff -ur pcmciautils-014/src/pccardctl.c pcmciautils-014-mine/src/pccardctl.c
--- pcmciautils-014/src/pccardctl.c     2006-06-01 11:07:52.000000000 +0200
+++ pcmciautils-014-mine/src/pccardctl.c        2007-01-09 21:29:25.000000000 
+0100
@@ -250,7 +250,7 @@
                        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]);
+               printf("  function: %d (%s)\n", manf_id, manf_id < 
sizeof(fn)/sizeof(*fn) ? fn[manf_id] : "unknown");
 
 
        return 0;
@@ -586,7 +586,7 @@
                                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]);
+                               printf("function: %d (%s)\n\t\t\t", manf_id, 
manf_id < sizeof(fn)/sizeof(*fn) ? fn[manf_id] : "unknown");
                        for (j=1;j<=4;j++) {
                                snprintf(file, SYSFS_PATH_MAX, "prod_id%d", j);
                                pccardctl_get_string(socket_no, file, &res);

Reply via email to