Skip to content

Commit 310e31b

Browse files
committed
crypto: octeontx2 - Call strscpy() with correct size argument
JIRA: https://issues.redhat.com/browse/RHEL-122025 Upstream Status: merged into the linux.git commit 361fa7f Author: Thorsten Blum <thorsten.blum@linux.dev> Date: Mon Aug 11 11:24:57 2025 +0200 crypto: octeontx2 - Call strscpy() with correct size argument In otx2_cpt_dl_custom_egrp_create(), strscpy() is called with the length of the source string rather than the size of the destination buffer. This is fine as long as the destination buffer is larger than the source string, but we should still use the destination buffer size instead to call strscpy() as intended. And since 'tmp_buf' is a fixed-size buffer, we can safely omit the size argument and let strscpy() infer it using sizeof(). Fixes: d9d7749 ("crypto: octeontx2 - add apis for custom engine groups") Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au> Signed-off-by: Vladis Dronov <vdronov@redhat.com>
1 parent a4a9d59 commit 310e31b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/crypto/marvell/octeontx2/otx2_cptpf_ucode.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1613,7 +1613,7 @@ int otx2_cpt_dl_custom_egrp_create(struct otx2_cptpf_dev *cptpf,
16131613
return -EINVAL;
16141614
}
16151615
err_msg = "Invalid engine group format";
1616-
strscpy(tmp_buf, ctx->val.vstr, strlen(ctx->val.vstr) + 1);
1616+
strscpy(tmp_buf, ctx->val.vstr);
16171617
start = tmp_buf;
16181618

16191619
has_se = has_ie = has_ae = false;

0 commit comments

Comments
 (0)