Skip to content

Commit 361fa7f

Browse files
tobluxherbertx
authored andcommitted
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>
1 parent 11d5674 commit 361fa7f

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
@@ -1615,7 +1615,7 @@ int otx2_cpt_dl_custom_egrp_create(struct otx2_cptpf_dev *cptpf,
16151615
return -EINVAL;
16161616
}
16171617
err_msg = "Invalid engine group format";
1618-
strscpy(tmp_buf, ctx->val.vstr, strlen(ctx->val.vstr) + 1);
1618+
strscpy(tmp_buf, ctx->val.vstr);
16191619
start = tmp_buf;
16201620

16211621
has_se = has_ie = has_ae = false;

0 commit comments

Comments
 (0)