Fix: flt.lttng-utils.debug-info: note name memcmp() overflow
authorFrancis Deslauriers <francis.deslauriers@efficios.com>
Tue, 21 May 2019 19:06:25 +0000 (15:06 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Wed, 29 May 2019 20:53:02 +0000 (16:53 -0400)
commita9d1c305b4f3e6991cd17e6b67e7e23071c41bdb
tree9c6962e54c127aa10f4f0d07e14b79de9f83fba8
parent199cb5d74bcdc3040c700de0d86cd3684922c6ce
Fix: flt.lttng-utils.debug-info: note name memcmp() overflow

Issue
=====
If the note section that we are currently parsing has a name longer
than the "GNU" string, the `memcmp()` call will read garbage after the
"GNU" string.

I witnessed this when the component was parsing a note section named
"stapsdt".

Solution
========
Make the section name length comparison explicit.

Drawbacks
=========
None.

Reported-by: Address Sanitizer - Global buffer overflow
Signed-off-by: Francis Deslauriers <francis.deslauriers@efficios.com>
Change-Id: I515f8c883ddbc1884045e86aecef700ee2111959
Reviewed-on: https://review.lttng.org/c/babeltrace/+/1322
Tested-by: jenkins
Reviewed-by: Philippe Proulx <eeppeliteloop@gmail.com>
plugins/lttng-utils/debug-info/bin-info.c
This page took 0.02537 seconds and 4 git commands to generate.