For new tickets please use the main OpenSC Trac (direct link)

Ticket #7 (closed defect: invalid)

Opened 6 years ago

Last modified 5 years ago

Segfault from libp11?

Reported by: martin Owned by: opensc-devel@…
Priority: normal Component: libp11
Version: 0.2.1 Severity: major
Keywords: Cc:

Change History

comment:1 Changed 5 years ago by aj

  • Status changed from new to closed
  • Resolution set to invalid

the bug here is the example code. this works fine for me:

#include <libp11.h>
#include <stdio.h>
int main(int argc, char **argv)
{
        PKCS11_CTX *ctx;
        int rc;
        ctx = PKCS11_CTX_new();
        if (!ctx) {
                fprintf(stderr, "fatal: PKCS11_CTX_new failed!");
                return 1;
        }
        rc = PKCS11_CTX_load(ctx, "/home/aj/opentest/lib/opensc-pkcs11.so");
        if (rc != 0) {
                printf("PKCS11_CTX_load returned %d\n", rc);
                PKCS11_CTX_free(ctx);
                return 1;
        }
        PKCS11_CTX_unload(ctx);
        PKCS11_CTX_free(ctx);
        return 0;
}

Note: See TracTickets for help on using tickets.