Skip to content

Commit 486bfb0

Browse files
committed
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: addde1f ("crypto: akcipher - Add sync interface without SG lists") Signed-off-by: Herbert Xu <[email protected]>
1 parent 891ebfd commit 486bfb0

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

crypto/akcipher.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,8 @@ EXPORT_SYMBOL_GPL(crypto_akcipher_sync_prep);
234234
int crypto_akcipher_sync_post(struct crypto_akcipher_sync_data *data, int err)
235235
{
236236
err = crypto_wait_req(err, &data->cwait);
237-
memcpy(data->dst, data->buf, data->dlen);
237+
if (data->dst)
238+
memcpy(data->dst, data->buf, data->dlen);
238239
data->dlen = data->req->dst_len;
239240
kfree_sensitive(data->req);
240241
return err;

0 commit comments

Comments
 (0)