Skip to content

Backport improved validation to version 6.3 - #1289

Merged
ajaust merged 3 commits into
equinor:version-6.3from
ajaust:version-6.3-validation-backport
Sep 7, 2026
Merged

Backport improved validation to version 6.3#1289
ajaust merged 3 commits into
equinor:version-6.3from
ajaust:version-6.3-validation-backport

Conversation

@ajaust

@ajaust ajaust commented Sep 4, 2026

Copy link
Copy Markdown
Collaborator

Recently improved validation of lgr_nr and rporv backported to version 6.3.

I need feedback if returning NULL instead of using util_abort in rd_grav_survey_alloc_RPORV is a good idea. It follows the same pattern (return NULL) used in rd_grav_survey_alloc_FIP.

@ajaust
ajaust changed the base branch from main to version-6.3 September 4, 2026 08:18
Comment thread lib/resdata/rd_grav.cpp
Comment on lines +466 to +472
if (rporv_size != active_size) {
fprintf(stderr,
"%s: %s keyword has %d elements, but the grid has %d "
"active cells\n",
__func__, RPORV_KW, rporv_size, active_size);
return NULL;
}

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this reasonable (similar approach as in rd_grav_survey_alloc_FIP) or should we rather fail hard using util_abort?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is a reasonable approach.

Validate LGR numbers before using them to index lgr_index_map. This
prevents negative values from malformed EGRID files being used.

Add a regression test covering a negative GRIDHEAD LGR number.
@ajaust
ajaust force-pushed the version-6.3-validation-backport branch from 2db4801 to 0c34f7f Compare September 4, 2026 08:21
@ajaust
ajaust marked this pull request as ready for review September 4, 2026 08:42
@ajaust
ajaust merged commit 51944e0 into equinor:version-6.3 Sep 7, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants