The vulnerability lies in the get_values function within the src/lib/irap_import_ascii.cpp file of the surfio library. The function is responsible for parsing the values of an IRAP ASCII surface. The patch 1619750bce28e39c4f378d2fb6d28b72380a12aa reveals that the function previously lacked a crucial size validation check. It would calculate the number of values to read (nvalues) based on the ncol and nrow parameters from the file's header and then proceed to read that many floats from the file's data section. An attacker could craft a malicious IRAP file with large ncol and nrow values in the header but provide a much smaller data section. This would cause the get_values function to attempt to read beyond the bounds of the provided data buffer, resulting in an out-of-bounds read and a process crash. The fix introduces a check that verifies if the size of the input data is sufficient for the dimensions declared in the header, preventing the overflow.