Skip to content

Commit

Permalink
pc: Fix unchecked strdup() by switching to fw_cfg_add_string()
Browse files Browse the repository at this point in the history
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
  • Loading branch information
Markus Armbruster authored and blueswirl committed Jan 19, 2013
1 parent 44687f7 commit 96f8058
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions hw/pc.c
Expand Up @@ -693,9 +693,7 @@ static void load_linux(void *fw_cfg,

fw_cfg_add_i32(fw_cfg, FW_CFG_CMDLINE_ADDR, cmdline_addr);
fw_cfg_add_i32(fw_cfg, FW_CFG_CMDLINE_SIZE, strlen(kernel_cmdline)+1);
fw_cfg_add_bytes(fw_cfg, FW_CFG_CMDLINE_DATA,
(uint8_t*)strdup(kernel_cmdline),
strlen(kernel_cmdline)+1);
fw_cfg_add_string(fw_cfg, FW_CFG_CMDLINE_DATA, kernel_cmdline);

if (protocol >= 0x202) {
stl_p(header+0x228, cmdline_addr);
Expand Down

0 comments on commit 96f8058

Please sign in to comment.