mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#3937 libecl : Workaround to avoid crash for some summary files
This commit is contained in:
11
ThirdParty/Ert/lib/ecl/ecl_smspec.cpp
vendored
11
ThirdParty/Ert/lib/ecl/ecl_smspec.cpp
vendored
@@ -844,11 +844,14 @@ static void ecl_smspec_install_special_keys( ecl_smspec_type * ecl_smspec , smsp
|
||||
hash_insert_ref( ecl_smspec->field_var_index , keyword , smspec_node );
|
||||
break;
|
||||
case(ECL_SMSPEC_GROUP_VAR):
|
||||
if (!hash_has_key(ecl_smspec->group_var_index , group))
|
||||
hash_insert_hash_owned_ref(ecl_smspec->group_var_index , group, hash_alloc() , hash_free__);
|
||||
if (group)
|
||||
{
|
||||
hash_type * var_hash = (hash_type*)hash_get(ecl_smspec->group_var_index , group);
|
||||
hash_insert_ref(var_hash , keyword , smspec_node );
|
||||
if (!hash_has_key(ecl_smspec->group_var_index , group))
|
||||
hash_insert_hash_owned_ref(ecl_smspec->group_var_index , group, hash_alloc() , hash_free__);
|
||||
{
|
||||
hash_type * var_hash = (hash_type*)hash_get(ecl_smspec->group_var_index , group);
|
||||
hash_insert_ref(var_hash , keyword , smspec_node );
|
||||
}
|
||||
}
|
||||
break;
|
||||
case(ECL_SMSPEC_REGION_VAR):
|
||||
|
||||
5
ThirdParty/Ert/lib/util/hash.cpp
vendored
5
ThirdParty/Ert/lib/util/hash.cpp
vendored
@@ -82,6 +82,11 @@ static void * __hash_get_node(const hash_type *__hash , const char *key, bool ab
|
||||
hash_type * hash = (hash_type *) __hash; /* The net effect is no change - but .... ?? */
|
||||
hash_node_type * node = NULL;
|
||||
{
|
||||
if (key == NULL)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
const uint32_t global_index = hash->hashf(key , strlen(key));
|
||||
const uint32_t table_index = (global_index % hash->size);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user