mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#4266 : libecl : Fix several crash issues
This commit is contained in:
parent
96a7f02abe
commit
a31d8cbea6
15
ThirdParty/Ert/lib/ecl/ecl_smspec.cpp
vendored
15
ThirdParty/Ert/lib/ecl/ecl_smspec.cpp
vendored
@ -232,6 +232,8 @@ static const char* smspec_required_keywords[] = {
|
||||
namespace {
|
||||
|
||||
const ecl::smspec_node * ecl_smspec_get_var_node( const node_map& mp, const char * var) {
|
||||
if (!var) return nullptr;
|
||||
|
||||
const auto it = mp.find(var);
|
||||
if (it == mp.end())
|
||||
return nullptr;
|
||||
@ -699,10 +701,15 @@ static void ecl_smspec_install_special_keys( ecl_smspec_type * ecl_smspec , cons
|
||||
ecl_smspec_get_well_var_index( smspec , well_name , var );
|
||||
*/
|
||||
|
||||
const char * well = smspec_node_get_wgname( &smspec_node );
|
||||
const char * group = well;
|
||||
const int num = smspec_node_get_num(&smspec_node);
|
||||
const char * keyword = smspec_node_get_keyword(&smspec_node);
|
||||
std::string well;
|
||||
if (smspec_node_get_wgname(&smspec_node)) well = smspec_node_get_wgname(&smspec_node);
|
||||
|
||||
std::string group = well;
|
||||
const int num = smspec_node_get_num(&smspec_node);
|
||||
|
||||
std::string keyword;
|
||||
if (smspec_node_get_keyword(&smspec_node)) keyword = smspec_node_get_keyword(&smspec_node);
|
||||
|
||||
ecl_smspec_var_type var_type = smspec_node_get_var_type(&smspec_node );
|
||||
|
||||
switch(var_type) {
|
||||
|
10
ThirdParty/Ert/lib/ecl/smspec_node.cpp
vendored
10
ThirdParty/Ert/lib/ecl/smspec_node.cpp
vendored
@ -329,7 +329,7 @@ std::string smspec_alloc_completion_ijk_key( const char * join_string , const st
|
||||
join_string ,
|
||||
i , j , k );
|
||||
else
|
||||
return NULL;
|
||||
return "";
|
||||
}
|
||||
|
||||
|
||||
@ -343,7 +343,7 @@ std::string smspec_alloc_completion_num_key( const char * join_string , const st
|
||||
join_string ,
|
||||
num );
|
||||
else
|
||||
return NULL;
|
||||
return "";
|
||||
}
|
||||
|
||||
/*
|
||||
@ -406,7 +406,7 @@ std::string smspec_alloc_segment_key( const char * join_string , const std::stri
|
||||
join_string ,
|
||||
num );
|
||||
else
|
||||
return NULL;
|
||||
return "";
|
||||
}
|
||||
|
||||
|
||||
@ -419,7 +419,7 @@ std::string smspec_alloc_local_well_key( const char * join_string , const std::s
|
||||
join_string ,
|
||||
wgname.c_str());
|
||||
else
|
||||
return NULL;
|
||||
return "";
|
||||
}
|
||||
|
||||
std::string smspec_alloc_local_completion_key( const char * join_string, const std::string& keyword , const std::string& lgr_name , const std::string& wgname , int i , int j , int k) {
|
||||
@ -433,7 +433,7 @@ std::string smspec_alloc_local_completion_key( const char * join_string, const s
|
||||
join_string ,
|
||||
i,j,k);
|
||||
else
|
||||
return NULL;
|
||||
return "";
|
||||
}
|
||||
|
||||
/*****************************************************************/
|
||||
|
Loading…
Reference in New Issue
Block a user