mirror of https://gitee.com/openkylin/libvirt.git
virExec: avoid undefined behavior
* src/util/util.c (__virExec): Don't use FD_ISSET on out-of-bounds fd.
This commit is contained in:
parent
044f2011aa
commit
c3568ec289
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue