agent: Protect commit 135b1e3 against misbehaving Libgcrypt.

* agent/command-ssh.c (ssh_key_to_blob): Check DATALEN.

Signed-off-by: Werner Koch <wk@gnupg.org>
This commit is contained in:
Werner Koch 2015-09-01 07:39:28 +02:00
parent f9c83d84e7
commit 9ba4ccdaf5
No known key found for this signature in database
GPG Key ID: E3FDFF218E45B72B
1 changed files with 1 additions and 1 deletions

View File

@ -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--;