Skip to content

Commit

Permalink
hw/r2d: add comment: this strncpy use is ok
Browse files Browse the repository at this point in the history
Signed-off-by: Jim Meyering <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
  • Loading branch information
Jim Meyering authored and Anthony Liguori committed Oct 5, 2012
1 parent 00ea188 commit 9310b9b
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions hw/r2d.c
Original file line number Diff line number Diff line change
Expand Up @@ -332,6 +332,8 @@ static void r2d_init(ram_addr_t ram_size,
}

if (kernel_cmdline) {
/* I see no evidence that this .kernel_cmdline buffer requires
NUL-termination, so using strncpy should be ok. */
strncpy(boot_params.kernel_cmdline, kernel_cmdline,
sizeof(boot_params.kernel_cmdline));
}
Expand Down

0 comments on commit 9310b9b

Please sign in to comment.