From 92ceb38c527f74004f7d59e849eb2649864204d5 Mon Sep 17 00:00:00 2001 From: wenlong12 Date: Wed, 3 Aug 2022 17:15:37 +0800 Subject: [PATCH] fix fuzz failed Signed-off-by:wenlong12 Signed-off-by: wenlong12 --- src/perf_file_format.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/perf_file_format.cpp b/src/perf_file_format.cpp index abe0c73..9a7ad27 100644 --- a/src/perf_file_format.cpp +++ b/src/perf_file_format.cpp @@ -384,7 +384,7 @@ PerfFileSectionEventDesc::PerfFileSectionEventDesc(FEATURE id, PerfFileSectionEventDesc::PerfFileSectionEventDesc(FEATURE id, const char *buf, size_t size) : PerfFileSection(id) { - constexpr uint32_t maxIds = 600; + constexpr uint32_t maxIds = 500; Init(buf, size); uint32_t nr = 0; if (!Read(nr)) { @@ -421,6 +421,9 @@ PerfFileSectionEventDesc::PerfFileSectionEventDesc(FEATURE id, const char *buf, return; } else if (nrIds > maxIds) { HLOGW("nrIds is too large ! %u", nrIds); +#ifdef FUZZER_TEST + return; +#endif } if (!Read(eventDesc.name)) { return; -- Gitee