mirror of
https://github.com/libvirt/libvirt.git
synced 2025-02-25 18:55:26 -06:00
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 != null &&
|
||||||
i != childout &&
|
i != childout &&
|
||||||
i != childerr &&
|
i != childerr &&
|
||||||
(!keepfd ||
|
(!keepfd || (i < FD_SETSIZE && !FD_ISSET(i, keepfd)))) {
|
||||||
!FD_ISSET(i, keepfd))) {
|
|
||||||
tmpfd = i;
|
tmpfd = i;
|
||||||
VIR_FORCE_CLOSE(tmpfd);
|
VIR_FORCE_CLOSE(tmpfd);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user