mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-25 01:34:11 +03: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 != 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
Block a user