Skip to content

Commit 4a39781

Browse files
[Coverity] - Fix Attempting to access the managed object of an empty smart pointer record (#68)
1 parent 6ff6a86 commit 4a39781

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/vpux_utils/src/profiling/parser/parser.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -279,8 +279,11 @@ RawProfilingRecords parseDPUTaskProfiling(
279279
record = std::make_shared<RawProfilingDPUHW27Record>(dpuTimings, taskMeta, variantId, currentPos,
280280
inClusterIndex);
281281
}
282-
record->checkData(!ignoreSanitizationErrors, log);
283-
rawRecords.push_back(record);
282+
// Check if record is initialized before using it
283+
if (record != nullptr) {
284+
record->checkData(!ignoreSanitizationErrors, log);
285+
rawRecords.push_back(record);
286+
}
284287
}
285288
// continue increment of currentPos to walk over non-used data
286289
++currentPos;

0 commit comments

Comments
 (0)