buffer-view: introduce lttng_buffer_view_contains_string
authorSimon Marchi <simon.marchi@efficios.com>
Fri, 29 Nov 2019 21:42:24 +0000 (16:42 -0500)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Fri, 17 Apr 2020 20:32:19 +0000 (16:32 -0400)
commit67d8e2ef48ea2cd334bf9efd90b58b976437a3cd
tree9536efd55c0dd3b0be43e029b5c16ccbf021880c
parent03bb2358875cfca96394e78357c96baaa1e91efa
buffer-view: introduce lttng_buffer_view_contains_string

This function can be used to safely validate that a string in a buffer
view has the length we expect.  The goal is to avoid doing any reads
outside the buffer view, whatever the input is, considering that the
buffer and advertised length of the string are untrusted data.

It will be used by subsequent patches to deserialize strings from
received buffers.

Change-Id: I8afc4b6f9334e035e0ef02cb96b157df59d8107d
Signed-off-by: Simon Marchi <simon.marchi@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
src/common/buffer-view.c
src/common/buffer-view.h
tests/unit/Makefile.am
tests/unit/test_buffer_view.c [new file with mode: 0644]
This page took 0.026335 seconds and 5 git commands to generate.