Skip to content

Commit 6ba6733

Browse files
tobluxtyhicks
authored andcommitted
ecryptfs: Drop redundant NUL terminations after calling ecryptfs_to_hex
ecryptfs_to_hex() already NUL-terminates the destination buffers. Drop the manual NUL terminations. Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev> Signed-off-by: Tyler Hicks <code@tyhicks.com>
1 parent e8fb5ec commit 6ba6733

2 files changed

Lines changed: 0 additions & 4 deletions

File tree

fs/ecryptfs/debug.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ void ecryptfs_dump_auth_tok(struct ecryptfs_auth_tok *auth_tok)
2828
ecryptfs_printk(KERN_DEBUG, " * passphrase type\n");
2929
ecryptfs_to_hex(salt, auth_tok->token.password.salt,
3030
ECRYPTFS_SALT_SIZE);
31-
salt[ECRYPTFS_SALT_SIZE * 2] = '\0';
3231
ecryptfs_printk(KERN_DEBUG, " * salt = [%s]\n", salt);
3332
if (auth_tok->token.password.flags &
3433
ECRYPTFS_PERSISTENT_PASSWORD) {

fs/ecryptfs/keystore.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -908,7 +908,6 @@ ecryptfs_parse_tag_70_packet(char **filename, size_t *filename_size,
908908
(*packet_size) += s->packet_size_len;
909909
ecryptfs_to_hex(s->fnek_sig_hex, &data[(*packet_size)],
910910
ECRYPTFS_SIG_SIZE);
911-
s->fnek_sig_hex[ECRYPTFS_SIG_SIZE_HEX] = '\0';
912911
(*packet_size) += ECRYPTFS_SIG_SIZE;
913912
s->cipher_code = data[(*packet_size)++];
914913
rc = ecryptfs_cipher_code_to_string(s->cipher_string,
@@ -1781,8 +1780,6 @@ int ecryptfs_parse_packet_set(struct ecryptfs_crypt_stat *crypt_stat,
17811780
}
17821781
ecryptfs_to_hex(new_auth_tok->token.password.signature,
17831782
sig_tmp_space, tag_11_contents_size);
1784-
new_auth_tok->token.password.signature[
1785-
ECRYPTFS_PASSWORD_SIG_SIZE] = '\0';
17861783
crypt_stat->flags |= ECRYPTFS_ENCRYPTED;
17871784
break;
17881785
case ECRYPTFS_TAG_1_PACKET_TYPE:

0 commit comments

Comments
 (0)