From: Mathieu Desnoyers Date: Fri, 12 Feb 2016 20:44:10 +0000 (-0500) Subject: Fix: handle negative range for LTTNG_UST_REGISTER_TIMEOUT X-Git-Tag: v2.8.0-rc1~45 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=5cf81d53e305c81517e48e0dc91620a916cdc0cc;p=lttng-ust.git Fix: handle negative range for LTTNG_UST_REGISTER_TIMEOUT We should not consider values below -1 as valid timeout values, this is is unexpected and could lead to EINVAL errors returned by sem_timedwait. Signed-off-by: Mathieu Desnoyers --- diff --git a/liblttng-ust/lttng-ust-comm.c b/liblttng-ust/lttng-ust-comm.c index c619b544..2ada5065 100644 --- a/liblttng-ust/lttng-ust-comm.c +++ b/liblttng-ust/lttng-ust-comm.c @@ -455,6 +455,9 @@ long get_timeout(void) } if (str_timeout) constructor_delay_ms = strtol(str_timeout, NULL, 10); + /* All negative values are considered as "-1". */ + if (constructor_delay_ms < -1) + constructor_delay_ms = -1; return constructor_delay_ms; }