mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#4211 libecl : Fix for access of data out of bounds
This commit is contained in:
2
ThirdParty/Ert/lib/ecl/ecl_smspec.cpp
vendored
2
ThirdParty/Ert/lib/ecl/ecl_smspec.cpp
vendored
@@ -325,7 +325,7 @@ int * ecl_smspec_alloc_mapping( const ecl_smspec_type * self, const ecl_smspec_t
|
|||||||
|
|
||||||
|
|
||||||
const smspec_node_type * ecl_smspec_iget_node( const ecl_smspec_type * smspec , int index ) {
|
const smspec_node_type * ecl_smspec_iget_node( const ecl_smspec_type * smspec , int index ) {
|
||||||
return (const smspec_node_type*)vector_iget_const( smspec->smspec_nodes , index );
|
return (const smspec_node_type*)vector_safe_iget_const( smspec->smspec_nodes , index );
|
||||||
}
|
}
|
||||||
|
|
||||||
int ecl_smspec_num_nodes( const ecl_smspec_type * smspec) {
|
int ecl_smspec_num_nodes( const ecl_smspec_type * smspec) {
|
||||||
|
|||||||
7
ThirdParty/Ert/lib/ecl/ecl_sum_data.cpp
vendored
7
ThirdParty/Ert/lib/ecl/ecl_sum_data.cpp
vendored
@@ -1087,8 +1087,11 @@ static void ecl_sum_data_init_double_vector__(const ecl_sum_data_type * data, in
|
|||||||
data_file->get_data(params_index, index_node.length, &output_data[offset]);
|
data_file->get_data(params_index, index_node.length, &output_data[offset]);
|
||||||
else {
|
else {
|
||||||
const smspec_node_type * smspec_node = ecl_smspec_iget_node(data->smspec, main_params_index);
|
const smspec_node_type * smspec_node = ecl_smspec_iget_node(data->smspec, main_params_index);
|
||||||
for (int i=0; i < index_node.length; i++)
|
if (smspec_node)
|
||||||
output_data[offset + i] = smspec_node_get_default(smspec_node);
|
{
|
||||||
|
for (int i=0; i < index_node.length; i++)
|
||||||
|
output_data[offset + i] = smspec_node_get_default(smspec_node);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
offset += index_node.length;
|
offset += index_node.length;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user