sbvarsign: auth descriptor hash does not cover the \0 in the varname
Signed-off-by: Jeremy Kerr <jeremy.kerr@canonical.com>
This commit is contained in:
parent
15354eaa4e
commit
c933b5e8fd
1 changed files with 2 additions and 4 deletions
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue