mirror of
https://github.com/torvalds/linux.git
synced 2026-01-25 07:47:50 +00:00
crypto: essiv - Replace memcpy() + NUL-termination with strscpy()
Use strscpy() to copy the NUL-terminated string 'p' to the destination buffer instead of using memcpy() followed by a manual NUL-termination. No functional changes intended. Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
This commit is contained in:
committed by
Herbert Xu
parent
27b1342534
commit
fdd305803b
@@ -405,8 +405,7 @@ static bool parse_cipher_name(char *essiv_cipher_name, const char *cra_name)
|
||||
if (len >= CRYPTO_MAX_ALG_NAME)
|
||||
return false;
|
||||
|
||||
memcpy(essiv_cipher_name, p, len);
|
||||
essiv_cipher_name[len] = '\0';
|
||||
strscpy(essiv_cipher_name, p, len + 1);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user