提交 48ab2099 编写于 作者: D Daniel P. Berrange

Fix off-by-1 in QEMU boot arg array handling

A QEMU guest can have upto VIR_DOMAIN_BOOT_LAST boot entries
defined. When building the QEMU arg, each entry takes a
single byte. This means the array must be declared to be
VIR_DOMAIN_BOOT_LAST+1 bytes in length to allow for the
trailing null

* src/qemu/qemu_conf.c: Fix off-by-1 boot arg array size
上级 df990b44
...@@ -3662,7 +3662,7 @@ int qemudBuildCommandLine(virConnectPtr conn, ...@@ -3662,7 +3662,7 @@ int qemudBuildCommandLine(virConnectPtr conn,
{ {
int i; int i;
char memory[50]; char memory[50];
char boot[VIR_DOMAIN_BOOT_LAST]; char boot[VIR_DOMAIN_BOOT_LAST+1];
struct utsname ut; struct utsname ut;
int disableKQEMU = 0; int disableKQEMU = 0;
int enableKQEMU = 0; int enableKQEMU = 0;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册