diff options
author | Constantin Kaplinsky <const@tightvnc.com> | 2008-06-23 01:32:53 +0000 |
---|---|---|
committer | Constantin Kaplinsky <const@tightvnc.com> | 2008-06-23 01:32:53 +0000 |
commit | 4f39f8edbe5bbef698b70056f89ebee15e30274b (patch) | |
tree | 906c0f5a088968c736546e2027c8763f50771cd8 /java/src/com/tightvnc | |
parent | 31b7a24a1aca6f44fd13977f7ad8f66961cc366b (diff) | |
download | tigervnc-4f39f8edbe5bbef698b70056f89ebee15e30274b.tar.gz tigervnc-4f39f8edbe5bbef698b70056f89ebee15e30274b.zip |
[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
Diffstat (limited to 'java/src/com/tightvnc')
-rw-r--r-- | java/src/com/tightvnc/rfbplayer/FbsConnection.java | 8 |
1 files changed, 8 insertions, 0 deletions
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"); |