tmf: Bug 507415: Fix some random file wrongly seen as Tar
authorMarc-Andre Laperle <marc-andre.laperle@ericsson.com>
Fri, 11 Nov 2016 05:56:43 +0000 (00:56 -0500)
committerMarc-André Laperle <marc-andre.laperle@ericsson.com>
Fri, 11 Nov 2016 21:11:12 +0000 (16:11 -0500)
Change-Id: Iff3ee2a5cad352f6b1f658e4da462dfe45e21418
Signed-off-by: Marc-Andre Laperle <marc-andre.laperle@ericsson.com>
Reviewed-on: https://git.eclipse.org/r/84852
Reviewed-by: Bernd Hufmann <bernd.hufmann@ericsson.com>
Tested-by: Bernd Hufmann <bernd.hufmann@ericsson.com>
Reviewed-by: Hudson CI
tmf/org.eclipse.tracecompass.tmf.ui/src/org/eclipse/tracecompass/internal/tmf/ui/project/wizards/importtrace/TarFile.java

index 101581d379f199e15c0aa52e9381bdb45478f0b9..3647aa14e2c2ceb006d344771fedfa0716b90472 100644 (file)
@@ -63,6 +63,9 @@ public class TarFile {
         entryEnumerationStream = new TarArchiveInputStream(fInputStream);
         try {
             curEntry = (TarArchiveEntry) entryEnumerationStream.getNextEntry();
+            if (!curEntry.isCheckSumOK()) {
+                throw new IOException("Error detected parsing initial entry header"); //$NON-NLS-1$
+            }
         } catch (IOException e) {
             fInputStream.close();
             throw e;
This page took 0.024366 seconds and 5 git commands to generate.