tmf: Fix hang in TarInputStream.skipToEntry when importing large tar.gz
authorMarc-Andre Laperle <marc-andre.laperle@ericsson.com>
Tue, 13 Sep 2016 22:08:21 +0000 (18:08 -0400)
committerMarc-Andre Laperle <marc-andre.laperle@ericsson.com>
Wed, 14 Sep 2016 13:36:01 +0000 (09:36 -0400)
commit5d5f933e72cc29d221f462c05441467fe2a9e412
tree643c8f58ee58e3ee48054507394ad68584275304
parent85ab284499e29c4beba4df18c6500072a667ec62
tmf: Fix hang in TarInputStream.skipToEntry when importing large tar.gz

When importing a large tar.gz archive, it can hang in
TarInputStream.skipToEntry. Depending on the size of the entries in the
Tar and the order in which they are read, it is possible that bytesread
will overflow and become negative. Because of that, the code that skips
bytes fails to skip properly and enters in an infinite loop.

This patch fixes the issue by making the bytesread a 'long'. Because
this class is in the platform, several files had to be copied over in
order to get the fix right away. Those files will be removed once the
fix is in the platform and that the fix is released.

Bug: 501379
Change-Id: Ia1613da08715968f23a803519a2e78aa7c51482f
Signed-off-by: Marc-Andre Laperle <marc-andre.laperle@ericsson.com>
Reviewed-on: https://git.eclipse.org/r/81044
Reviewed-by: Hudson CI
tmf/org.eclipse.tracecompass.tmf.ui/src/org/eclipse/tracecompass/internal/tmf/ui/project/wizards/importtrace/ArchiveUtil.java
tmf/org.eclipse.tracecompass.tmf.ui/src/org/eclipse/tracecompass/internal/tmf/ui/project/wizards/importtrace/FileSystemObjectImportStructureProvider.java
tmf/org.eclipse.tracecompass.tmf.ui/src/org/eclipse/tracecompass/internal/tmf/ui/project/wizards/importtrace/ImportTraceWizardPage.java
tmf/org.eclipse.tracecompass.tmf.ui/src/org/eclipse/tracecompass/internal/tmf/ui/project/wizards/importtrace/TarEntry.java [new file with mode: 0644]
tmf/org.eclipse.tracecompass.tmf.ui/src/org/eclipse/tracecompass/internal/tmf/ui/project/wizards/importtrace/TarException.java [new file with mode: 0644]
tmf/org.eclipse.tracecompass.tmf.ui/src/org/eclipse/tracecompass/internal/tmf/ui/project/wizards/importtrace/TarFile.java [new file with mode: 0644]
tmf/org.eclipse.tracecompass.tmf.ui/src/org/eclipse/tracecompass/internal/tmf/ui/project/wizards/importtrace/TarFileSystemObject.java
tmf/org.eclipse.tracecompass.tmf.ui/src/org/eclipse/tracecompass/internal/tmf/ui/project/wizards/importtrace/TarInputStream.java [new file with mode: 0644]
tmf/org.eclipse.tracecompass.tmf.ui/src/org/eclipse/tracecompass/internal/tmf/ui/project/wizards/importtrace/TarLeveledStructureProvider.java [new file with mode: 0644]
tmf/org.eclipse.tracecompass.tmf.ui/src/org/eclipse/tracecompass/internal/tmf/ui/project/wizards/tracepkg/AbstractTracePackageOperation.java
tmf/org.eclipse.tracecompass.tmf.ui/src/org/eclipse/tracecompass/internal/tmf/ui/project/wizards/tracepkg/importexport/TracePackageImportOperation.java
This page took 0.027632 seconds and 5 git commands to generate.