Skip to content

Conversation

@marc-evans
Copy link
Contributor

In grid2fits.c: readGridExtFromFits() the grid is malloc'd initially with a call to mallocAndSetDefaultGrid()
using nSpecies=0. However, this means that (*gp).[i].mol is never malloc'd and therefore later when
abundances are read in (block starting line 1155) LIME segfaults. This is a simple fix that moves the nSpecies determination to before the mallocAndSetDefaultGrid() call and passes this as an argument so that (*gp).[i].mol is malloc'd correctly if appropriate. I don't think this breaks anything or causes any unintended behaviour.

… malloc'd.

Before, in grid2fits.c the grid was malloc'd initially with a call to mallocAndSetDefaultGrid()
using nSpecies=0. However, this meant that (*gp).[i].mol was never malloc'd so that later when
abundances were read in it would cause a segfault. This is a simple fix that moves nSpecies
determination to before the mallocAndSetDefaultGrid() call and passes this as an argument so that
(*gp).[i].mol is malloc'd correctly if appropriate.
@allegroLeiden allegroLeiden merged commit ea5327a into lime-rt:master Apr 19, 2017
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