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)
committerPhilippe Proulx <eeppeliteloop@gmail.com>
Tue, 28 May 2019 13:52:09 +0000 (09:52 -0400)
commit233b228c8d1fefaa04e33730bc67d7c010a3d4dd
tree0c1451cb11145178722c6f7f0d90f29574f15d82
parent42521b696131e2ccaa3622f297f97df6e90827e6
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.024355 seconds and 4 git commands to generate.