mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 11:11:45 -04:00
ecryptfs: fix string overflow on long cipher names
Passing a cipher name > 32 chars on mount results in an overflow when the cipher name is printed, because the last character in the struct ecryptfs_key_tfm's cipher_name string was never zeroed. Signed-off-by: Eric Sandeen <[email protected]> Acked-by: Michael Halcrow <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
This commit is contained in:
parent
ed367fc3a7
commit
b88629060b
1 changed files with 1 additions and 0 deletions
|
|
@ -1847,6 +1847,7 @@ ecryptfs_add_new_key_tfm(struct ecryptfs_key_tfm **key_tfm, char *cipher_name,
|
|||
mutex_init(&tmp_tfm->key_tfm_mutex);
|
||||
strncpy(tmp_tfm->cipher_name, cipher_name,
|
||||
ECRYPTFS_MAX_CIPHER_NAME_SIZE);
|
||||
tmp_tfm->cipher_name[ECRYPTFS_MAX_CIPHER_NAME_SIZE] = '\0';
|
||||
tmp_tfm->key_size = key_size;
|
||||
rc = ecryptfs_process_key_cipher(&tmp_tfm->key_tfm,
|
||||
tmp_tfm->cipher_name,
|
||||
|
|
|
|||
Loading…
Reference in a new issue