Skip to content

Commit

Permalink
mra/exporters/CSVExporter: Fix aanother potential buffer underflow ex…
Browse files Browse the repository at this point in the history
…ception.
  • Loading branch information
paulosousadias committed Sep 26, 2024
1 parent 0095622 commit 38969a1
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions src/java/pt/lsts/neptus/mra/exporters/CSVExporter.java
Original file line number Diff line number Diff line change
Expand Up @@ -297,13 +297,18 @@ private void applyFilter(boolean entFiles) {
pmonitor.setNote(I18n.textf("Exporting %message data to %csvfile...", message, out.getAbsolutePath()));
bw.write(getHeader(message));
for (int row = 0; row < source.getLsfIndex().getNumberOfMessages(); row++) {
if (source.getLsfIndex().getMessage(row).getMessageType().getShortName().equals(message)) {
if (entities.contains(source.getLsfIndex().entityNameOf(row))) {
bw.write(getLine(source.getLsfIndex().getMessage(row)));
try {
if (source.getLsfIndex().getMessage(row).getMessageType().getShortName().equals(message)) {
if (entities.contains(source.getLsfIndex().entityNameOf(row))) {
bw.write(getLine(source.getLsfIndex().getMessage(row)));
}
}
if (!filter.isVisible()) {
break;
}
} catch (Exception e) {
NeptusLog.pub().warn(e.getMessage());
}
if (!filter.isVisible())
break;
}
bw.close();
progress++;
Expand Down

0 comments on commit 38969a1

Please sign in to comment.