From 4f39f8edbe5bbef698b70056f89ebee15e30274b Mon Sep 17 00:00:00 2001 From: Constantin Kaplinsky Date: Mon, 23 Jun 2008 01:32:53 +0000 Subject: [Enhancement] Validating the .fbi file contents - timestamps should go in ascending order. git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@2613 3789f03b-4d11-0410-bbf8-ca57d06f2519 --- java/src/com/tightvnc/rfbplayer/FbsConnection.java | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'java/src/com/tightvnc') diff --git a/java/src/com/tightvnc/rfbplayer/FbsConnection.java b/java/src/com/tightvnc/rfbplayer/FbsConnection.java index 9b38652e..5c3ca82b 100644 --- a/java/src/com/tightvnc/rfbplayer/FbsConnection.java +++ b/java/src/com/tightvnc/rfbplayer/FbsConnection.java @@ -162,6 +162,14 @@ public class FbsConnection { System.err.println("Could not load index: failed to load .fbi file"); return; } + // Check correctness of the data read. + for (int i = 1; i < numRecordsRead; i++) { + if (newIndex[i].timestamp <= newIndex[i-1].timestamp) { + System.err.println("Could not load index: wrong .fbi file contents"); + return; + } + } + // Loaded successfully. indexData = newIndex; numIndexRecords = numRecordsRead; System.err.println("Loaded index data, " + numRecordsRead + " records"); -- cgit v1.2.3