Skip to content

Add input guards to fortio_fread_buffer for parity with resdata PR #1189#14208

Merged
magnesj merged 1 commit into
devfrom
update-resdata-1189-backport-fixes
Jun 11, 2026
Merged

Add input guards to fortio_fread_buffer for parity with resdata PR #1189#14208
magnesj merged 1 commit into
devfrom
update-resdata-1189-backport-fixes

Conversation

@magnesj

@magnesj magnesj commented Jun 11, 2026

Copy link
Copy Markdown
Member

Adds two input-validation guards to fortio_fread_buffer in ResInsight's vendored copy of resdata (ThirdParty/Ert/lib/ecl/fortio.c), for parity with upstream resdata PR equinor/resdata#1189 ("Fix validation of record_size in fortio_fread_buffer").

The function now rejects a null buffer (with non-zero size) and a negative buffer_size up front, returning false instead of risking a null dereference or falling through to util_abort.

ResInsight carries an older fork of resdata, so the upstream rewrite cannot be applied verbatim. The core buffer-overflow protection from the upstream fix is already present in this fork via #14144 ("Guard against buffer overflow when reading corrupt well data records"); these two input-validation guards are the only remaining delta.



Reject null buffers and negative buffer sizes up front, returning false instead of risking a null dereference or hitting util_abort. The buffer-overflow protection from the upstream fix is already present via #14144; these two input-validation guards are the remaining delta.
@magnesj magnesj requested a review from jonjenssen June 11, 2026 14:02
@magnesj magnesj merged commit 3a3a53f into dev Jun 11, 2026
20 checks passed
@magnesj magnesj deleted the update-resdata-1189-backport-fixes branch June 11, 2026 20:26
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