Commit 486bfb05 authored by Herbert Xu's avatar Herbert Xu
Browse files

crypto: akcipher - Do not copy dst if it is NULL



As signature verification has a NULL destination buffer, the pointer
needs to be checked before the memcpy is done.

Fixes: addde1f2 ("crypto: akcipher - Add sync interface without SG lists")
Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
parent 891ebfdf
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -234,6 +234,7 @@ EXPORT_SYMBOL_GPL(crypto_akcipher_sync_prep);
int crypto_akcipher_sync_post(struct crypto_akcipher_sync_data *data, int err)
{
	err = crypto_wait_req(err, &data->cwait);
	if (data->dst)
		memcpy(data->dst, data->buf, data->dlen);
	data->dlen = data->req->dst_len;
	kfree_sensitive(data->req);