summaryrefslogtreecommitdiffstatsabout
diff options
context:
space:
mode:
authorEtienne Bergeron2013-11-15 21:57:08 (EST)
committer Alexandre Montplaisir2013-11-18 15:10:35 (EST)
commite2daaafd9ae8fb4334cb3b88a1a6ac2d153f0c09 (patch)
tree7eeb9ffb54407813039398c7a47c8b26ed5acfd7
parent00c62c3308c96ec2ae0d1480b86ef3890aebb861 (diff)
downloadorg.eclipse.linuxtools-e2daaafd9ae8fb4334cb3b88a1a6ac2d153f0c09.zip
org.eclipse.linuxtools-e2daaafd9ae8fb4334cb3b88a1a6ac2d153f0c09.tar.gz
org.eclipse.linuxtools-e2daaafd9ae8fb4334cb3b88a1a6ac2d153f0c09.tar.bz2
Fix invalid cast which break trace files bigger than 2 gig.refs/changes/56/18456/3
The min operation received a value which can be negative after the cast. (Values bigger then 2^31). Thus, the trace files has one chance on two to open. Change-Id: Id97578f430af8336bab9d863f575f46ed7f54adc Signed-off-by: Etienne Bergeron <etienne.bergeron@gmail.com> Reviewed-on: https://git.eclipse.org/r/18456 Reviewed-by: Alexandre Montplaisir <alexmonthy@voxpopuli.im> IP-Clean: Alexandre Montplaisir <alexmonthy@voxpopuli.im> Tested-by: Hudson CI
-rw-r--r--lttng/org.eclipse.linuxtools.ctf.core/src/org/eclipse/linuxtools/ctf/core/trace/CTFTrace.java2
1 files changed, 1 insertions, 1 deletions
diff --git a/lttng/org.eclipse.linuxtools.ctf.core/src/org/eclipse/linuxtools/ctf/core/trace/CTFTrace.java b/lttng/org.eclipse.linuxtools.ctf.core/src/org/eclipse/linuxtools/ctf/core/trace/CTFTrace.java
index 925a684..a9ccc2b 100644
--- a/lttng/org.eclipse.linuxtools.ctf.core/src/org/eclipse/linuxtools/ctf/core/trace/CTFTrace.java
+++ b/lttng/org.eclipse.linuxtools.ctf.core/src/org/eclipse/linuxtools/ctf/core/trace/CTFTrace.java
@@ -531,7 +531,7 @@ public class CTFTrace implements IDefinitionScope {
fc = fis.getChannel();
/* Map one memory page of 4 kiB */
- byteBuffer = fc.map(MapMode.READ_ONLY, 0, Math.min((int) fc.size(), 4096));
+ byteBuffer = fc.map(MapMode.READ_ONLY, 0, (int) Math.min(fc.size(), 4096L));
} catch (IOException e) {
/* Shouldn't happen at this stage if every other check passed */
throw new CTFReaderException(e);