[PATCH] card_status for cm4000 / segfault in ifdhandler

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

[PATCH] card_status for cm4000 / segfault in ifdhandler

Harald Welte
Hi!

After some months of other hacking, I'm back to chipcard-related stuff.  

This is a patch [against current svn] that implements card_status
detection for the cm4000 driver (see attachment).

For some strange reason, when using this patch, ifdhandler segfaults:
---
#0  0x0000000000406919 in ifd_card_status (reader=0x0, idx=0, status=0x7fffffd12564)
    at reader.c:186
186             reader->slot[idx].status = *status;
(gdb) p reader
$1 = (ifd_reader_t *) 0x0
---

This really looks strange to me, and I cannot see how my cm4000-related
patch should cause a problem that makes "reader" NULL somwhere in the
openct core.  Any ideas?

--
- Harald Welte <[hidden email]>                  http://gnumonks.org/
============================================================================
"Privacy in residential applications is a desirable marketing option."
                                                  (ETSI EN 300 175-7 Ch. A6)

_______________________________________________
opensc-devel mailing list
[hidden email]
http://www.opensc.org/cgi-bin/mailman/listinfo/opensc-devel

openct-cm4000-cardstatus.diff (1K) Download Attachment
attachment1 (196 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: [PATCH] card_status for cm4000 / segfault in ifdhandler

Harald Welte
On Fri, Sep 02, 2005 at 08:56:48PM +0200, Harald Welte wrote:
> This is a patch [against current svn] that implements card_status
> detection for the cm4000 driver (see attachment).
>
> For some strange reason, when using this patch, ifdhandler segfaults:

Please ignore that patch and my segfault observation.  This is due to
stack corruption by the kernel side ioctl (I'm passing 'unsigned char'
whereas the kernel driver sends back 'unsigned int'.

--
- Harald Welte <[hidden email]>                  http://gnumonks.org/
============================================================================
"Privacy in residential applications is a desirable marketing option."
                                                  (ETSI EN 300 175-7 Ch. A6)

_______________________________________________
opensc-devel mailing list
[hidden email]
http://www.opensc.org/cgi-bin/mailman/listinfo/opensc-devel

attachment0 (196 bytes) Download Attachment