clear command line buffer before filling it with the property

This commit is contained in:
Laurent Vivier 2006-12-29 20:29:19 +00:00
parent 58efcb5f44
commit e68b0482e8

View File

@ -184,7 +184,8 @@ int read_config(emile_l2_header_t* info,
*command_line = (char*)malloc(COMMAND_LINE_LENGTH); *command_line = (char*)malloc(COMMAND_LINE_LENGTH);
if (*command_line == NULL) if (*command_line == NULL)
return -1; return -1;
strncpy(*command_line, property, COMMAND_LINE_LENGTH); memset(*command_line, 0, COMMAND_LINE_LENGTH);
strncpy(*command_line, property, COMMAND_LINE_LENGTH - 1);
} }
if (get_property(info->configuration, "initrd", property) == 0) if (get_property(info->configuration, "initrd", property) == 0)