Skip to content

Commit

Permalink
append the terminating '\0' to bootorder string
Browse files Browse the repository at this point in the history
Problem was introduced in commit c8a6ae8. The last terminating
'\0' was lost, use the right length 5 ("HALT\0").

Reported-by: Gerd Hoffmann <[email protected]>
Signed-off-by: Amos Kong <[email protected]>
Message-id: [email protected]
Signed-off-by: Anthony Liguori <[email protected]>
  • Loading branch information
amoskong authored and Anthony Liguori committed Apr 2, 2013
1 parent a130c6b commit 4690579
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions vl.c
Original file line number Diff line number Diff line change
Expand Up @@ -1278,9 +1278,9 @@ char *get_boot_devices_list(size_t *size)

if (boot_strict && *size > 0) {
list[total-1] = '\n';
list = g_realloc(list, total + 4);
memcpy(&list[total], "HALT", 4);
*size = total + 4;
list = g_realloc(list, total + 5);
memcpy(&list[total], "HALT", 5);
*size = total + 5;
}
return list;
}
Expand Down

0 comments on commit 4690579

Please sign in to comment.