From c933b5e8fd39e85ace978cbd1f3072bcd9598e26 Mon Sep 17 00:00:00 2001 From: Jeremy Kerr Date: Wed, 5 Sep 2012 11:16:42 +0800 Subject: [PATCH] sbvarsign: auth descriptor hash does not cover the \0 in the varname Signed-off-by: Jeremy Kerr --- src/sbvarsign.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/sbvarsign.c b/src/sbvarsign.c index 36142a5..37f5ec2 100644 --- a/src/sbvarsign.c +++ b/src/sbvarsign.c @@ -168,15 +168,13 @@ static int set_varname(struct varsign_context *ctx, const char *str) len = strlen(str); - wstr = talloc_array(ctx, CHAR16, len + 1); + wstr = talloc_array(ctx, CHAR16, len); for (i = 0; i < len; i++) wstr[i] = str[i]; - wstr[i] = '\0'; - ctx->var_name = wstr; - ctx->var_name_bytes = i * sizeof(CHAR16); + ctx->var_name_bytes = len * sizeof(CHAR16); return 0; }