Fix: handle negative range for LTTNG_UST_REGISTER_TIMEOUT
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Fri, 12 Feb 2016 20:44:10 +0000 (15:44 -0500)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Fri, 12 Feb 2016 20:46:19 +0000 (15:46 -0500)
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 <mathieu.desnoyers@efficios.com>
liblttng-ust/lttng-ust-comm.c

index 8effa36999bb8230f5b1718a8a2aa60808305343..f08e7b0698a83e1834c3c6dea2e2badb81b22bb0 100644 (file)
@@ -437,6 +437,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;
 }
 
This page took 0.026471 seconds and 4 git commands to generate.