aboutsummaryrefslogtreecommitdiffstats
path: root/src/core/select.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/select.c')
-rw-r--r--src/core/select.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/core/select.c b/src/core/select.c
index 69fa763c..70047f09 100644
--- a/src/core/select.c
+++ b/src/core/select.c
@@ -522,7 +522,7 @@ int osmo_select_main_ctx(int polling)
* \returns \ref osmo_fd for \ref fd; NULL in case it doesn't exist */
struct osmo_fd *osmo_fd_get_by_fd(int fd)
{
- if (fd > maxfd)
+ if (fd > maxfd || fd < 0)
return NULL;
return osmo_fd_lookup.table[fd];
}