summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Wu <peter@lekensteyn.nl>2015-07-07 15:50:52 +0200
committerPeter Wu <peter@lekensteyn.nl>2015-07-07 19:32:03 +0200
commit0fdf8c3d4a4348452f28c037e422c489605c91d7 (patch)
tree001ae905ff25fb5a037b2f13d3a1067cbbdde8d8
parent0a7547e487a8bc4e7ac9599c55579eb2e4a13f06 (diff)
downloadlibgcrypt-0fdf8c3d4a4348452f28c037e422c489605c91d7.tar.gz
sexp: fix invalid deallocation in error path
* src/sexp.c: Fix wrong condition in error path. -- This appears to be a copy and paste error and could result in wrong memory being freed in the error path (when arrayisdesx[idx] == 2, the condition ((!2) == 1) is false). Signed-off-by: Peter Wu <peter@lekensteyn.nl>
-rw-r--r--src/sexp.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/sexp.c b/src/sexp.c
index 9bc13caf..1c014e0c 100644
--- a/src/sexp.c
+++ b/src/sexp.c
@@ -2405,7 +2405,7 @@ _gcry_sexp_vextract_param (gcry_sexp_t sexp, const char *path,
_gcry_mpi_release (*array[idx]);
*array[idx] = NULL;
}
- else if (!arrayisdesc[idx] == 1)
+ else if (arrayisdesc[idx] == 1)
{
/* Caller provided buffer. */
gcry_buffer_t *spec = (gcry_buffer_t*)array[idx];