提交 c3568ec2 编写于 作者: E Eric Blake

virExec: avoid undefined behavior

* src/util/util.c (__virExec): Don't use FD_ISSET on out-of-bounds fd.
上级 044f2011
......@@ -570,8 +570,7 @@ __virExec(const char *const*argv,
i != null &&
i != childout &&
i != childerr &&
(!keepfd ||
!FD_ISSET(i, keepfd))) {
(!keepfd || (i < FD_SETSIZE && !FD_ISSET(i, keepfd)))) {
tmpfd = i;
VIR_FORCE_CLOSE(tmpfd);
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册