summaryrefslogtreecommitdiff
path: root/tools/perf/util/symbol-minimal.c
diff options
context:
space:
mode:
Diffstat (limited to 'tools/perf/util/symbol-minimal.c')
-rw-r--r--tools/perf/util/symbol-minimal.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/perf/util/symbol-minimal.c b/tools/perf/util/symbol-minimal.c
index 41e4ebe5eac5..aeb253248895 100644
--- a/tools/perf/util/symbol-minimal.c
+++ b/tools/perf/util/symbol-minimal.c
@@ -42,7 +42,7 @@ static int read_build_id(void *note_data, size_t note_len, struct build_id *bid,
void *ptr;
ptr = note_data;
- while (ptr < (note_data + note_len)) {
+ while ((ptr + sizeof(*nhdr)) < (note_data + note_len)) {
const char *name;
size_t namesz, descsz;