Mentions légales du service

Skip to content
Snippets Groups Projects
Commit d754acb8 authored by hhakim's avatar hhakim
Browse files

Secure input argument type in Cpu TransformHelper::update.

parent bee683e7
No related branches found
No related tags found
No related merge requests found
...@@ -764,9 +764,13 @@ template<typename FPP> ...@@ -764,9 +764,13 @@ template<typename FPP>
else if(ds_mat = dynamic_cast<MatDense<FPP,Cpu>*>(&M_)) else if(ds_mat = dynamic_cast<MatDense<FPP,Cpu>*>(&M_))
{ {
if(! (ds_fact = dynamic_cast<MatDense<FPP,Cpu>*>(fact))) if(! (ds_fact = dynamic_cast<MatDense<FPP,Cpu>*>(fact)))
throw std::runtime_error("A dense factor can't be updated with a dense factor"); throw std::runtime_error("A dense factor can't be updated with a sparse factor");
*ds_fact = *ds_mat; *ds_fact = *ds_mat;
} }
else
{
throw std::runtime_error("Only MatSparse and MatDense are accepted by TransformHelper::update().");
}
fact->set_id(M.is_id()); fact->set_id(M.is_id());
update_total_nnz(); update_total_nnz();
#if USE_GPU_MOD #if USE_GPU_MOD
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment