diff options
author | Werner Koch <[email protected]> | 2005-07-20 15:05:05 +0000 |
---|---|---|
committer | Werner Koch <[email protected]> | 2005-07-20 15:05:05 +0000 |
commit | 68191d0c935719d9ab171e49b6456372c72cf1c4 (patch) | |
tree | 895ecabf2a925e1e5b8128a509284f1c6d66e61f /scd/app-openpgp.c | |
parent | (gpgsm_get_certid): Cast printf arg to unsigned. (diff) | |
download | gnupg-68191d0c935719d9ab171e49b6456372c72cf1c4.tar.gz gnupg-68191d0c935719d9ab171e49b6456372c72cf1c4.zip |
* keylist.c (email_kludge): Reworked.
* certdump.c (gpgsm_print_serial, gpgsm_dump_serial): Cast printf
arg to unsigned.
* call-dirmngr.c (gpgsm_dirmngr_run_command): Ditto
Diffstat (limited to '')
-rw-r--r-- | scd/app-openpgp.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/scd/app-openpgp.c b/scd/app-openpgp.c index 11e6eebaf..bd56fb99d 100644 --- a/scd/app-openpgp.c +++ b/scd/app-openpgp.c @@ -1230,8 +1230,15 @@ do_readkey (app_t app, const char *keyid, unsigned char **pk, size_t *pklen) buf = app->app_local->pk[keyno-1].key; if (!buf) return gpg_error (GPG_ERR_NO_PUBKEY); - *pk = buf; *pklen = app->app_local->pk[keyno-1].keylen;; + *pk = xtrymalloc (*pklen); + if (!*pk) + { + err = gpg_error_from_errno (errno); + *pklen = 0; + return err; + } + memcpy (*pk, buf, *pklen); return 0; #else return gpg_error (GPG_ERR_NOT_IMPLEMENTED); |