From 6ce39a21d82fc283badb7d318f5373c1d703024a Mon Sep 17 00:00:00 2001 From: "git@daemon.de" Date: Tue, 7 Jul 2015 09:46:23 +0200 Subject: [PATCH] fixed compile error (unused var) --- bindings/cpp/key.cpp | 2 +- libpcp/mgmt.c | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/bindings/cpp/key.cpp b/bindings/cpp/key.cpp index 021b74e..f4a2c75 100644 --- a/bindings/cpp/key.cpp +++ b/bindings/cpp/key.cpp @@ -129,7 +129,7 @@ string Key::export_secret(const string &passphrase) { string Key::export_public() { Buffer *exported_pk; - exported_pk = pcp_export_rfc_pub(K); + exported_pk = pcp_export_rfc_pub(PTX->ptx, K); if(exported_pk == NULL) throw pcp::exception(PTX); diff --git a/libpcp/mgmt.c b/libpcp/mgmt.c index cedd533..2da4582 100644 --- a/libpcp/mgmt.c +++ b/libpcp/mgmt.c @@ -716,6 +716,9 @@ Buffer *pcp_export_rfc_pub (PCPCTX *ptx, pcp_key_t *sk) { memset(sig, 0, crypto_sign_BYTES + crypto_generichash_BYTES_MAX); free(sig); + if(out->end < 32) + fatal(ptx, "failed to export public key"); + return out; }