From 9ba4ccdaf5e128fbea51ff142c63d4b359c7264d Mon Sep 17 00:00:00 2001 From: Werner Koch Date: Tue, 1 Sep 2015 07:39:28 +0200 Subject: agent: Protect commit 135b1e3 against misbehaving Libgcrypt. * agent/command-ssh.c (ssh_key_to_blob): Check DATALEN. Signed-off-by: Werner Koch --- agent/command-ssh.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'agent/command-ssh.c') diff --git a/agent/command-ssh.c b/agent/command-ssh.c index 689241f67..88686200a 100644 --- a/agent/command-ssh.c +++ b/agent/command-ssh.c @@ -1964,7 +1964,7 @@ ssh_key_to_blob (gcry_sexp_t sexp, int with_secret, err = gpg_error (GPG_ERR_INV_SEXP); goto out; } - if (*p_elems == 'q') + if (*p_elems == 'q' && datalen) { /* Remove the prefix 0x40. */ data++; datalen--; -- cgit v1.2.3