Fixes a Coverity warning.
Change-Id: Ic11af8b32d7dccf136812400a689964c04bedf50
Signed-off-by: Alexandre Montplaisir <alexmonthy@efficios.com>
Reviewed-on: https://git.eclipse.org/r/81497
Reviewed-by: Hudson CI
Reviewed-by: Genevieve Bastien <gbastien+lttng@versatic.net>
Tested-by: Genevieve Bastien <gbastien+lttng@versatic.net>
FileChannel fc = fis.getChannel();) {
ByteBuffer buffer = ByteBuffer.allocate(TREE_HEADER_SIZE);
FileChannel fc = fis.getChannel();) {
ByteBuffer buffer = ByteBuffer.allocate(TREE_HEADER_SIZE);
buffer.order(ByteOrder.LITTLE_ENDIAN);
buffer.clear();
buffer.order(ByteOrder.LITTLE_ENDIAN);
buffer.clear();
+
+ res = fc.read(buffer);
+ if (res != TREE_HEADER_SIZE) {
+ throw new IOException("Invalid header size"); //$NON-NLS-1$
+ }
+