The vulnerability details explicitly name GAMESSOutputFormat::ReadMolecule as the flawed function. Analysis of the provided patch commit 95033d27d23c07f98daa92d3cd3ae5ea07594a91 confirms this. The changes are located in src/formats/gamessformat.cpp within the OpenBabel::GAMESSOutputFormat::ReadMolecule method. The patch adds bounds checks (if (vs.size() >= ...) before accessing elements of the vs vector. This directly addresses the reported use-after-free, which occurs when a malformed GAMESS output file lacks the expected tokens on lines with "ICHARG=" or "MULT", causing an out-of-bounds vector access. The test file test/fuzzregresstest.cpp also explicitly states that this is a heap-use-after-free in GAMESSOutputFormat::ReadMolecule.