X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;f=plugins%2Flttng-utils%2Fdebug-info%2Fbin-info.c;h=280462906b8192cd8e98ea6f84eb1adde02cea80;hb=233b228c8d1fefaa04e33730bc67d7c010a3d4dd;hp=f861b2ed78966aeb56118bf583dc4a85884156d3;hpb=42521b696131e2ccaa3622f297f97df6e90827e6;p=babeltrace.git diff --git a/plugins/lttng-utils/debug-info/bin-info.c b/plugins/lttng-utils/debug-info/bin-info.c index f861b2ed..28046290 100644 --- a/plugins/lttng-utils/debug-info/bin-info.c +++ b/plugins/lttng-utils/debug-info/bin-info.c @@ -251,8 +251,18 @@ int is_build_id_note_section(uint8_t *buf) * - Note type */ name_sz = (uint32_t) *buf; + + /* + * Check the note name length. The name_sz field includes the + * terminating null byte. + */ + if (name_sz != sizeof(BUILD_ID_NOTE_NAME)) { + goto invalid; + } + buf += sizeof(name_sz); + /* Ignore the note description size. */ buf += sizeof(desc_sz); note_type = (uint32_t) *buf;