Clean-up: sessiond: silence negative index warning
authorJérémie Galarneau <jeremie.galarneau@efficios.com>
Thu, 29 Oct 2020 15:43:35 +0000 (11:43 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Thu, 29 Oct 2020 15:43:35 +0000 (11:43 -0400)
commit0e43bcbfbc967868b8b939e378268d6296011886
tree4af311e8ac611301c8a9275aed518a8836a43915
parentff588497b3dfc3138c9ce005e9270ed5568c05df
Clean-up: sessiond: silence negative index warning

Coverity warns that `lttng_action_get_type()` can return
a negative index (LTTNG_ACTION_TYPE_UNKNOWN). This scenario
is not reachable, but a check is added to silence the analyzer.

Original report:
  1435955 Negative array index read

  A memory location at a negative offset from the beginning of the array
  will be read, resulting in incorrect values.

  In get_action_name: Negative value used to index an array in a read
  operation (CWE-129)

Reported-by: Coverity Scan
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Change-Id: I5952096a1d29f0d4a3c4350a2a842874d5f3973b
src/bin/lttng-sessiond/action-executor.c
This page took 0.033082 seconds and 4 git commands to generate.