Skip to content

Commit f728dd0

Browse files
committed
Fix possible out-of-bounds access on proto_->file_attrs.
Fuzzer test was showing an out-of-bounds accesss on a repeated field somewhere in `ReadNonHeaderEventDataWithoutHeader`. Staring at the code found this one. PiperOrigin-RevId: 713486488
1 parent dc234b7 commit f728dd0

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/quipper/perf_reader.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1171,7 +1171,7 @@ bool PerfReader::ReadNonHeaderEventDataWithoutHeader(
11711171

11721172
if (event->header.type == PERF_RECORD_MMAP ||
11731173
event->header.type == PERF_RECORD_MMAP2) {
1174-
if (proto_->file_attrs(0).has_attr() &&
1174+
if (proto_->file_attrs_size() > 0 && proto_->file_attrs(0).has_attr() &&
11751175
proto_->file_attrs(0).attr().exclude_kernel() &&
11761176
event->header.misc & PERF_RECORD_MISC_KERNEL && event->mmap.len == 0) {
11771177
// A buggy version of perf emits zero-length MMAP records for the kernel

0 commit comments

Comments
 (0)