In the function MSCEstablishConnection in musclecard.c, around line 488 is the 
following code:

        rv = (*libPL_MSCInitializePlugin) (pConnection);

        if (rv != MSC_SUCCESS)
        {
                //...
                        TPUnloadToken(pConnection);
                //...
        }

        if (sharingMode != MSC_SHARE_DIRECT)
        {       
                // ...
                        rv = (*libPL_MSCIdentifyToken) (pConnection);

If libPL_MSCInitializePlugin returns something other than MSC_SUCCESS and 
sharingMode is something other than MSC_SHARE_DIRECT, the token library will 
be unloaded by TPUnloadToken and then shortly thereafter 
libPL_MSCIdentifyToken, is a function in the just-unloaded token library, 
will be called, causing a segfault.

I think the attached patch is the correct fix.

Thanks,

        Shawn.
--- musclecard.c.orig	2006-01-24 13:40:11.000000000 -0700
+++ musclecard.c	2006-01-24 13:40:14.000000000 -0700
@@ -494,6 +494,7 @@
 			pConnection->tokenLibHandle = 0;
 		}
 		pConnection->hCard = 0;
+		return rv;
 	}
 
 	if (sharingMode != MSC_SHARE_DIRECT)

Attachment: pgpA8W6U2XeVt.pgp
Description: PGP signature

_______________________________________________
Muscle mailing list
[email protected]
http://lists.drizzle.com/mailman/listinfo/muscle

Reply via email to