stardis

Perform coupled heat transfer calculations
git clone git://git.meso-star.fr/stardis.git
Log | Files | Refs | README | LICENSE

commit 315e6a52ae5381b7c9b02bc0980ccdfe6d7400e5
parent 6b5e90ad29580c580a440c8fd006b202d0a2d21f
Author: vincent.forest@meso-star.com <vincent.forest@meso-star.com>
Date:   Fri, 25 Apr 2025 11:46:54 +0200

Fix invalid memory accesses when writing green

When retrieving the initial time, the stardis-solver data type was
incorrectly considered to be a pointer to the medium properties, whereas
it is a pointer to a pointer to the medium properties. In other words,
an indirection was missing. This led to invalid memory reads and,
consequently, to erroneous data being written to the output green
function.

Diffstat:
Msrc/stardis-output.c | 4++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/stardis-output.c b/src/stardis-output.c @@ -638,10 +638,10 @@ medium_get_t0 type = sdis_medium_get_type(medium); data = sdis_medium_get_data(medium); if(type == SDIS_FLUID) { - const struct fluid* fluid_props = sdis_data_cget(data); + const struct fluid* fluid_props = *((const struct fluid**)sdis_data_cget(data)); return fluid_props->t0; } else { - const struct solid* solid_props = sdis_data_cget(data); + const struct solid* solid_props = *((const struct solid**)sdis_data_cget(data)); ASSERT(type == SDIS_SOLID); return solid_props->t0; }