summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author이춘석/On-Device Lab(SR)/Staff Engineer/삼성전자 <chunseok.lee@samsung.com>2019-12-12 01:06:50 (GMT)
committer오형석/On-Device Lab(SR)/Staff Engineer/삼성전자 <hseok82.oh@samsung.com>2019-12-12 01:06:50 (GMT)
commit4e9f700bb70ba0083a985495c486fa6a4754a059 (patch)
treeddfd4e0840bcfb1cb46c49f3df661e55d12c3cf4
parent06195e39e210ef94de7445fb0c491ca3f105539c (diff)
downloadnnfw-coverity.zip
nnfw-coverity.tar.gz
nnfw-coverity.tar.bz2
Fix svace WID : 539647 (#9536)coverity
fixed by throw execption instead of assert Signed-off-by: Chunseok Lee <chunseok.lee@samsung.com>
-rw-r--r--runtime/neurun/frontend/base_loader/base_loader.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/runtime/neurun/frontend/base_loader/base_loader.h b/runtime/neurun/frontend/base_loader/base_loader.h
index 9e3e181..1733c2a 100644
--- a/runtime/neurun/frontend/base_loader/base_loader.h
+++ b/runtime/neurun/frontend/base_loader/base_loader.h
@@ -875,7 +875,8 @@ void BaseLoader<LoaderDomain, SpecificLoader>::loadSqueeze(const Operator *op)
const auto *dims = options->squeeze_dims();
if (dims)
{
- assert(dims->Length() <= sizeof(param.dims));
+ if (dims->Length() > sizeof(param.dims) / sizeof(param.dims[0]))
+ throw std::runtime_error("Squeeze: 'param.ndims' is out of range.");
param.ndim = dims->Length();
for (int i = 0; i < param.ndim; ++i)
param.dims[i] = dims->Get(i);