Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[onert-micro] Resolve svace warning #13557

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions onert-micro/luci-interpreter/src/core/RuntimeGraph.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -417,6 +417,7 @@ uint8_t *RuntimeGraph::getConstDataByTensor(const circle::Tensor *raw_tensor)
#endif // ENABLE_TRAINING

auto const &buffer = wrap(_reader->buffers()[raw_tensor->buffer()]->data());
assert(buffer.data() != nullptr);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

a function 'luci_interpreter::RuntimeGraph::getConstDataByTensor' is dereferenced at While.cpp:110 without checking for null


return const_cast<uint8_t *>(buffer.data());
}
Expand Down
2 changes: 1 addition & 1 deletion onert-micro/luci-interpreter/src/kernels/ExpandDims.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ void configure_kernel_CircleExpandDims(const circle::Operator *cur_op,
auto axis_data = runtime_graph->getConstDataByTensor(axis);
assert(axis_data != nullptr);

int32_t axis_value;
int32_t axis_value = -1;
Copy link
Contributor Author

@ljwoo94 ljwoo94 Jul 29, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Uninitialized data is read from local variable 'axis_value' at ExpandDims.cpp:59.


switch (Tensor::element_type(axis))
{
Expand Down
1 change: 1 addition & 0 deletions onert-micro/luci-interpreter/src/kernels/Unpack.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ void UnpackImpl(const circle::Operator *cur_op, const circle::Tensor *input, int
const auto t = runtime_graph->getCircleTensorByIndex(output_index);
assert(output0 != nullptr);
T *output_data = kernels::getTensorData<T>(runtime_graph->getDataByTensor(t));
assert(output_data != nullptr);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

luci_interpreter::kernels::getTensorData' is dereferenced at Unpack.cpp:78 without checking for null

for (int k = 0; k < outer_size; ++k)
{
T *output_ptr = output_data + copy_size * k;
Expand Down