提交 8d8e1d9d 编写于 作者: M Michal Privoznik

cmdFreepages: initialize @tmp

In the 404bac14 the @tmp variable was introduced. It's purpose is to
avoid typecasting when parsing --pagesize argument. However, if the
argument is not presented, tmp may be used uninitialized resulting in
bogus virNodeGetFreePages() API call:

virsh freepages --cellno 2
error: Failed to open file '/sys/devices/system/node/node2/hugepages/hugepages-4294967295kB/free_hugepages': No such file or directory
Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
上级 4a82ef92
......@@ -229,7 +229,7 @@ cmdFreepages(vshControl *ctl, const vshCmd *cmd)
bool ret = false;
unsigned int npages;
unsigned int *pagesize = NULL;
unsigned long long tmp;
unsigned long long tmp = 0;
int cell;
unsigned long long *counts = NULL;
size_t i, j;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册