summaryrefslogtreecommitdiff
path: root/src/shared/ask-password-api.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/shared/ask-password-api.c')
-rw-r--r--src/shared/ask-password-api.c6
1 files changed, 1 insertions, 5 deletions
diff --git a/src/shared/ask-password-api.c b/src/shared/ask-password-api.c
index a86b0db554..65151b19a6 100644
--- a/src/shared/ask-password-api.c
+++ b/src/shared/ask-password-api.c
@@ -139,11 +139,7 @@ static int add_to_keyring(const char *keyname, AskPasswordFlags flags, char **pa
if (r < 0)
return r;
- /* Truncate trailing NUL */
- assert(n > 0);
- assert(p[n-1] == 0);
-
- serial = add_key("user", keyname, p, n-1, KEY_SPEC_USER_KEYRING);
+ serial = add_key("user", keyname, p, n, KEY_SPEC_USER_KEYRING);
memory_erase(p, n);
if (serial == -1)
return -errno;