Skip to content

Fix util_abort called with too few arguments#1137

Merged
eivindjahren merged 1 commit intomainfrom
fix_missing_func
Apr 17, 2026
Merged

Fix util_abort called with too few arguments#1137
eivindjahren merged 1 commit intomainfrom
fix_missing_func

Conversation

@eivindjahren
Copy link
Copy Markdown
Collaborator

Issue
Resolves https://github.com/equinor/resdata/security/code-scanning/9 and two similar security reports

@eivindjahren eivindjahren self-assigned this Apr 16, 2026
@eivindjahren eivindjahren moved this to Ready for Review in SCOUT Apr 16, 2026
@eivindjahren eivindjahren requested a review from Copilot April 16, 2026 12:56
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Fixes format-string argument mismatches in a couple of util_abort() call sites to address CodeQL/security scanning findings (and prevent undefined behavior when aborting).

Changes:

  • Add missing __func__ argument to util_abort() in well_segment_link_strict().
  • Add missing __func__ argument to util_abort() in two grid keyword copy abort paths.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
lib/resdata/well_segment.cpp Fixes %s format specifier mismatch by passing __func__ to util_abort() in strict segment linking failure path.
lib/resdata/rd_grid.cpp Fixes %s format specifier mismatch by passing __func__ to util_abort() in two size-mismatch abort paths.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Copy Markdown

@ajaust ajaust left a comment

Choose a reason for hiding this comment

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

Looks good.

Should we -Wformat to the default compile options? This might be able to detect such errors at compile time.

@github-project-automation github-project-automation bot moved this from Ready for Review to Reviewed in SCOUT Apr 16, 2026
@eivindjahren eivindjahren merged commit 2512f6a into main Apr 17, 2026
17 checks passed
@eivindjahren eivindjahren deleted the fix_missing_func branch April 17, 2026 05:48
@github-project-automation github-project-automation bot moved this from Reviewed to Done in SCOUT Apr 17, 2026
@eivindjahren
Copy link
Copy Markdown
Collaborator Author

@ajaust we have -Wall (which gives -Wformat=1), but not -WError and there are a number of warnings. We should probably get that fixed also.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants