MaginnGroup / Cassandra

Cassandra is a Monte Carlo package to conduct atomistic simulations.
https://cassandra.nd.edu/
GNU General Public License v3.0
39 stars 20 forks source link

Functions for converting strings to numbers don't verify that the string is a valid number. #123

Closed rwsmith7531 closed 2 years ago

rwsmith7531 commented 2 years ago

Functions for converting strings to numbers don't verify that the string is a valid number. String_To_Doubleand String_To_Intuse IACHARto get the integer equivalent of a numeric character, but they assume and don't verify that the character is numeric. This can be catastrophic. For example, if a user gives "None" where there should be "0" or "0.0", the conversion function would translate "None" to 36973 without questioning the result. This phenomenon was discovered after a new user mistakenly put a neutral atom's charge as "None" or "none", which caused severely nonphysical simulation results.