aboutsummaryrefslogtreecommitdiff
path: root/monitor.c
diff options
context:
space:
mode:
authorYury Kotov <yury-kotov@yandex-team.ru>2019-05-23 12:44:33 +0300
committerMarkus Armbruster <armbru@redhat.com>2019-06-17 20:36:56 +0200
commit854f63d44065567c2991b5050f7d4011ca985c4e (patch)
tree2d98fc1c268d82e4e9fbf2882cec3ee589aa8fdd /monitor.c
parent076243ffe6c1b687e9e6d98348c3bf3398df78f3 (diff)
monitor: Fix return type of monitor_fdset_dup_fd_find
monitor_fdset_dup_fd_find_remove() and monitor_fdset_dup_fd_find() return mon_fdset->id which is int64_t. Downcasting from int64_t to int leads to a bug with removing fd from fdset with id >= 2^32. So, fix return types for these function. Signed-off-by: Yury Kotov <yury-kotov@yandex-team.ru> Reviewed-by: Markus Armbruster <armbru@redhat.com> Message-Id: <20190523094433.30297-1-yury-kotov@yandex-team.ru> Signed-off-by: Markus Armbruster <armbru@redhat.com>
Diffstat (limited to 'monitor.c')
-rw-r--r--monitor.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/monitor.c b/monitor.c
index 5c5cbe254a..dce3496920 100644
--- a/monitor.c
+++ b/monitor.c
@@ -2604,7 +2604,7 @@ err:
return -1;
}
-static int monitor_fdset_dup_fd_find_remove(int dup_fd, bool remove)
+static int64_t monitor_fdset_dup_fd_find_remove(int dup_fd, bool remove)
{
MonFdset *mon_fdset;
MonFdsetFd *mon_fdset_fd_dup;
@@ -2632,7 +2632,7 @@ err:
return -1;
}
-int monitor_fdset_dup_fd_find(int dup_fd)
+int64_t monitor_fdset_dup_fd_find(int dup_fd)
{
return monitor_fdset_dup_fd_find_remove(dup_fd, false);
}