Skip to content

Commit

Permalink
avoid nullptr deref in gammalaw (#533)
Browse files Browse the repository at this point in the history
  • Loading branch information
baperry2 authored Oct 7, 2024
1 parent e371e15 commit 37efd19
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions Source/Eos/GammaLaw.H
Original file line number Diff line number Diff line change
Expand Up @@ -478,10 +478,10 @@ struct GammaLaw
AMREX_GPU_HOST_DEVICE
GammaLaw(const EosParm<GammaLaw>* eparm)
{
AMREX_ASSERT_WITH_MESSAGE(
eparm != nullptr,
"GammaLaw Eos initialized with eosparm, but eosparm was not initialized");
gamma = eparm->gamma;
// This should eventually error out if eparm is nullptr
// But for now we require that eparm->gamma=gamma anyway,
// and this supports some potential legacy use cases for now
gamma = (eparm != nullptr) ? eparm->gamma : gamma;
}

template <class... Args>
Expand Down

0 comments on commit 37efd19

Please sign in to comment.