diff options
author | Justus Winter <justus@g10code.com> | 2015-12-07 12:44:48 +0100 |
---|---|---|
committer | Justus Winter <justus@g10code.com> | 2015-12-07 12:44:48 +0100 |
commit | b9c02fbeb7efb7d0593b33485fb30c298291cf80 (patch) | |
tree | 4ef5c4e223577b423986a481f3ece8a7cfcc3145 | |
parent | ca06cd7f77acb317c2649c58918908f043dfe6bd (diff) | |
download | libgcrypt-b9c02fbeb7efb7d0593b33485fb30c298291cf80.tar.gz |
cipher: Improve error handling.
* cipher/ecc.c (ecc_decrypt_raw): Improve error handling.
--
Found using the Clang Static Analyzer.
Signed-off-by: Justus Winter <justus@g10code.com>
-rw-r--r-- | cipher/ecc.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/cipher/ecc.c b/cipher/ecc.c index e4e9139d..105650e0 100644 --- a/cipher/ecc.c +++ b/cipher/ecc.c @@ -1591,7 +1591,10 @@ ecc_decrypt_raw (gcry_sexp_t *r_plain, gcry_sexp_t s_data, gcry_sexp_t keyparms) rawmpi = _gcry_mpi_get_buffer_extra (x, ec->nbits/8, -1, &rawmpilen, NULL); if (!rawmpi) - rc = gpg_err_code_from_syserror (); + { + rc = gpg_err_code_from_syserror (); + goto leave; + } else { rawmpi[0] = 0x40; |