Let's allocate enough space for the keyring structure, and not a pointer to it.

This commit is contained in:
agc 2009-04-26 16:55:44 +00:00
parent d0ea34baab
commit f5bbd5a825
1 changed files with 1 additions and 1 deletions

View File

@ -192,7 +192,7 @@ netpgp_init(netpgp_t *netpgp, char *userid, char *pubring, char *secring)
(void) snprintf(ringname, sizeof(ringname), "%s/.gnupg/secring.gpg", homedir);
secring = ringname;
}
keyring = calloc(1, sizeof(keyring));
keyring = calloc(1, sizeof(*keyring));
if (!__ops_keyring_read_from_file(keyring, false, secring)) {
(void) fprintf(stderr, "Cannot read sec keyring %s\n", secring);
return 0;