Ticket #2 (closed defect: wontfix)
NB! Read about ReportingBugs before filing a ticket!
pkcs11 segfaults
| Reported by: | aj | Owned by: | devel |
|---|---|---|---|
| Priority: | normal | Milestone: | |
| Component: | pkcs11 | Version: | 0.9.5 |
| Severity: | normal | Keywords: | |
| Cc: | Blocked By: | ||
| Blocking: |
Description
#include "pkcs11-internal.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, NULL); printf("PKCS11_CTX_load returned %d\n",rc);
PKCS11_CTX_unload(ctx); PKCS11_CTX_free(ctx); return 0;
}
Change History
comment:3 Changed 5 years ago by aj
the bug is in 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.

do you have a backtrace ?