Skip to content

Commit

Permalink
Merge pull request mzmine#601 from SteffenHeu/tdf_infinite_loop_fix
Browse files Browse the repository at this point in the history
prevent tdf import from infinite loop on corrupt data
  • Loading branch information
robinschmid authored Mar 17, 2022
2 parents 4611ede + 919cd2c commit 46ab2ad
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -654,8 +654,11 @@ private boolean printLastError(long errorCode) {
final String errorMessage = new String(errorBuffer, "UTF-8");
logger.fine(() -> "Last TDF import error: " + errorMessage + " length: " + len
+ ". Required buffer size: " + errorCode + " actual size: " + BUFFER_SIZE);
if(errorMessage.contains("CorruptFrameDataError")) {
throw new IllegalStateException("Error reading tdf raw data. " + errorMessage);
}
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
logger.log(Level.WARNING, e.getMessage(), e);
}
return true;
} else {
Expand Down

0 comments on commit 46ab2ad

Please sign in to comment.