Fix: src.ctf.fs: metadata-info: sanitize `path` param
authorFrancis Deslauriers <francis.deslauriers@efficios.com>
Tue, 30 Apr 2019 17:51:03 +0000 (13:51 -0400)
committerPhilippe Proulx <eeppeliteloop@gmail.com>
Thu, 2 May 2019 04:12:56 +0000 (00:12 -0400)
commit04297e7fd3ac772a72c6920b3e7f06054355075c
tree91a9d3f2124961759ae6f624564bd584ee0d09ad
parent0677a46a6ff52e82f9128536d4a4a97a9b09d014
Fix: src.ctf.fs: metadata-info: sanitize `path` param

Issue
=====
Omitting to pass the mandatory `path` parameter to the `metadata-info`
query results in a BT_ASSERT() failure when calling
bt_value_get_string(), or a NULL pointer dereference in non-DEV_MODE.

Similarly, setting the `path` to a non-string value would also result in
a BT_ASSERT() failure, or a invalid memory access in non-DEV_MODE

Solution
========
Confirm that the `path` parameter is present and is of the string type and
print error messages accordingly it's not.

Known drawbacks
===============
None.

Signed-off-by: Francis Deslauriers <francis.deslauriers@efficios.com>
Change-Id: I8182de2797c375262d77a4a8961bedb4c5ef9578
Reviewed-on: https://review.lttng.org/c/babeltrace/+/1081
Reviewed-by: Philippe Proulx <eeppeliteloop@gmail.com>
plugins/ctf/fs-src/query.c
This page took 0.024378 seconds and 5 git commands to generate.