From Coverity:
CID
1431053 (#1 of 2): Improper use of negative value (NEGATIVE_RETURNS)
5. negative_returns: fd_count is passed to a parameter that cannot be
negative.
Solution
========
Check return value for fd_count and goto error if negative.
Signed-off-by: Jonathan Rajotte <jonathan.rajotte-julien@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Change-Id: Ibdb2f065f0ebe51efae9125630a17730386395ac
lttng_dynamic_array_init(&raw_fds, sizeof(int), NULL);
+ if (fd_count < 0) {
+ ret = -LTTNG_ERR_INVALID;
+ goto end;
+ }
+
/*
* Prepare a contiguous array of file descriptors to send them.
*