Skip to content

Commit 0514ba3

Browse files
[Coverity] - Fix Attempting to access the managed object of an empty smart pointer record (#50)
* [Coverity] - Fix Attempting to access the managed object of an empty smart pointer record * [Follow up] vpucostmodel updated
1 parent 6b95a84 commit 0514ba3

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

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

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -291,8 +291,11 @@ RawProfilingRecords parseDPUTaskProfiling(
291291
record = std::make_shared<RawProfilingDPUHW27Record>(dpuTimings, taskMeta, variantId, currentPos,
292292
inClusterIndex);
293293
}
294-
record->checkDataOrDie();
295-
rawRecords.push_back(record);
294+
// Check if record is initialized before using it
295+
if (record != nullptr) {
296+
record->checkDataOrDie();
297+
rawRecords.push_back(record);
298+
}
296299
}
297300
// continue increment of currentPos to walk over non-used data
298301
++currentPos;

0 commit comments

Comments
 (0)