[TRUEZIP-313] CLONE -IllegalArgumentException when creating a TPath for a rooted path name with spaces Created: 20/Nov/12  Updated: 19/Jul/13  Resolved: 20/Nov/12

Status: Closed
Project: TrueZIP
Component/s: TrueZIP Path
Affects Version/s: TrueZIP 7.7
Fix Version/s: TrueZIP 7.7.1

Type: Bug Priority: Major
Reporter: Konstantin Gribov Assignee: Christian Schlichtherle
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: 0 minutes
Time Spent: Not Specified
Original Estimate: 0 minutes
Environment:

linux x64
oracle/sun jdk7, openjdk7



 Description   

When I use Paths.get("/some/path/with spaces") I get usual Path object that allows me to get it contens.

But if I try to create instance of TPath new TPath("/some/path/with spaces") I'll get an IllegalArgumentException:

Exception in thread "main" java.lang.IllegalArgumentException: java.net.URISyntaxException: Illegal character in path at index 15: /some/path/with spaces
	at net.java.truevfs.access.TPath.name(TPath.java:371)
	at net.java.truevfs.access.TPath.<init>(TPath.java:138)
	...
Caused by: java.net.URISyntaxException: Illegal character in path at index 15: /some/path/with spaces
	at java.net.URI$Parser.fail(URI.java:2829)
	at java.net.URI$Parser.checkChars(URI.java:3002)
	at java.net.URI$Parser.parseHierarchical(URI.java:3086)
	at java.net.URI$Parser.parse(URI.java:3044)
	at java.net.URI.<init>(URI.java:595)
	at net.java.truevfs.access.TPath.name(TPath.java:367)


 Comments   
Comment by Christian Schlichtherle [ 20/Nov/12 ]

This happens only if the path name starts with a path name separator ('/' on Unix), i.e. if it's rooted.

Comment by Christian Schlichtherle [ 20/Nov/12 ]

Changeset: 4854ba2daa6d
Author: Christian Schlichtherle <christian AT schlichtherle DOT de>
Date: 2012-11-20 20:50
Message: Fixed.
Issue #TRUEZIP-313 - CLONE -IllegalArgumentException when creating a TPath for a rooted path name with spaces





[TRUEZIP-299] CLONE -ArrayIndexOutOfBounds when reading an Extra field Created: 20/Oct/12  Updated: 19/Jul/13  Resolved: 21/Nov/12

Status: Closed
Project: TrueZIP
Component/s: TrueZIP Driver ZIP
Affects Version/s: TrueZIP 7.6.6
Fix Version/s: TrueZIP 7.7.1

Type: Bug Priority: Major
Reporter: jamieb22 Assignee: Christian Schlichtherle
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: 0 minutes
Time Spent: Not Specified
Original Estimate: 0 minutes
Environment:

BSD


Tags: extra, field

 Description   

2012-10-19 16:25:33.127 ERROR - error occurred while archiving blob. blob will be reprocessed on server restart
java.lang.ArrayIndexOutOfBoundsException: null
at java.lang.System.arraycopy(Native Method)
at net.java.truevfs.comp.zip.DefaultExtraField.readFrom(DefaultExtraField.java:48)
at net.java.truevfs.comp.zip.ExtraFields.readFrom(ExtraFields.java:166)
at net.java.truevfs.comp.zip.ZipEntry.setExtraFields(ZipEntry.java:611)
at net.java.truevfs.comp.zip.ZipEntry.setRawExtraFields(ZipEntry.java:591)
at net.java.truevfs.comp.zip.AbstractZipFile.recoverLostEntries(AbstractZipFile.java:541)
at net.java.truevfs.comp.zipdriver.AbstractZipDriver.newInput(AbstractZipDriver.java:320)
at net.java.truevfs.comp.zipdriver.AbstractZipDriver.newInput(AbstractZipDriver.java:45)
at net.java.truevfs.kernel.spec.FsArchiveDriver.newInput(FsArchiveDriver.java:196)
at net.java.truevfs.kernel.impl.TargetArchiveController.liftedTree1$1(TargetArchiveController.scala:148)
at net.java.truevfs.kernel.impl.TargetArchiveController.mount0(TargetArchiveController.scala:147)
at net.java.truevfs.kernel.impl.TargetArchiveController.mount(TargetArchiveController.scala:107)
at net.java.truevfs.kernel.impl.FileSystemArchiveController$ResetFileSystem.autoMount(FileSystemArchiveController.scala:69)
at net.java.truevfs.kernel.impl.FileSystemArchiveController.autoMount(FileSystemArchiveController.scala:36)
at net.java.truevfs.kernel.impl.BasicArchiveController.checkAccess(BasicArchiveController.scala:55)
at net.java.truevfs.kernel.impl.DefaultManager$BackController.net$java$truevfs$kernel$impl$SyncController$$super$checkAccess(DefaultManager.scala:161)
at net.java.truevfs.kernel.impl.SyncController$$anonfun$checkAccess$1.apply$mcV$sp(SyncController.scala:38)
at net.java.truevfs.kernel.impl.SyncController$$anonfun$checkAccess$1.apply(SyncController.scala:38)
at net.java.truevfs.kernel.impl.SyncController$$anonfun$checkAccess$1.apply(SyncController.scala:38)
at net.java.truevfs.kernel.impl.SyncController$class.net$java$truevfs$kernel$impl$SyncController$$apply(SyncController.scala:119)
at net.java.truevfs.kernel.impl.SyncController$class.checkAccess(SyncController.scala:38)
at net.java.truevfs.kernel.impl.DefaultManager$BackController.net$java$truevfs$kernel$impl$LockController$$super$checkAccess(DefaultManager.scala:161)
at net.java.truevfs.kernel.impl.LockController$$anonfun$checkAccess$1.apply$mcV$sp(LockController.scala:47)
at net.java.truevfs.kernel.impl.LockController$$anonfun$checkAccess$1.apply(LockController.scala:47)
at net.java.truevfs.kernel.impl.LockController$$anonfun$checkAccess$1.apply(LockController.scala:47)
at net.java.truevfs.kernel.impl.LockingStrategy.apply(LockingStrategy.scala:84)
at net.java.truevfs.kernel.impl.LockController$class.timedReadOrWriteLocked(LockController.scala:103)
at net.java.truevfs.kernel.impl.LockController$class.checkAccess(LockController.scala:47)
at net.java.truevfs.kernel.impl.DefaultManager$BackController.checkAccess(DefaultManager.scala:161)
at net.java.truevfs.kernel.impl.ArchiveControllerAdapter.checkAccess(ArchiveControllerAdapter.scala:22)
at net.java.truevfs.kernel.spec.FsAccessOptionsController.checkAccess(FsAccessOptionsController.java:83)
at net.java.truevfs.kernel.spec.FsDecoratingController.checkAccess(FsDecoratingController.java:53)
at net.java.truevfs.kernel.impl.FalsePositiveArchiveController$$anonfun$checkAccess$1.apply(FalsePositiveArchiveController.scala:74)
at net.java.truevfs.kernel.impl.FalsePositiveArchiveController$$anonfun$checkAccess$1.apply(FalsePositiveArchiveController.scala:74)
at net.java.truevfs.kernel.impl.FalsePositiveArchiveController$TryChild$.apply(FalsePositiveArchiveController.scala:195)
at net.java.truevfs.kernel.impl.FalsePositiveArchiveController.net$java$truevfs$kernel$impl$FalsePositiveArchiveController$$apply(FalsePositiveArchiveController.scala:172)
at net.java.truevfs.kernel.impl.FalsePositiveArchiveController.checkAccess(FalsePositiveArchiveController.scala:74)
at net.java.truevfs.ext.pacemaker.AspectController$$anonfun$checkAccess$1.apply$mcV$sp(AspectController.scala:37)
at net.java.truevfs.ext.pacemaker.AspectController$$anonfun$checkAccess$1.apply(AspectController.scala:37)
at net.java.truevfs.ext.pacemaker.AspectController$$anonfun$checkAccess$1.apply(AspectController.scala:37)
at net.java.truevfs.ext.pacemaker.PaceController.apply(PaceController.scala:24)
at net.java.truevfs.ext.pacemaker.AspectController.checkAccess(AspectController.scala:37)
at net.java.truevfs.access.TFile.exists(TFile.java:1660)
at com.stimulus.archiva.store.VolumeStoreV1.insertBlob(VolumeStoreV1.java:344)
at com.stimulus.archiva.store.BlobStore.insertBlob(BlobStore.java:157)
at com.stimulus.archiva.archive.ArchiveEngine.archiveBlob(ArchiveEngine.java:286)
at com.stimulus.archiva.archive.ArchiveEngine.archiveBlob(ArchiveEngine.java:201)
at com.stimulus.archiva.archive.ArchiveEngine.archiveBlob(ArchiveEngine.java:166)
at com.stimulus.archiva.receive.ReceiveService.archive(ReceiveService.java:361)
at com.stimulus.archiva.receive.ReceiveService.route(ReceiveService.java:444)
at com.stimulus.archiva.receive.ReceiveService.processFileQueueItem(ReceiveService.java:322)
at com.stimulus.archiva.queue.FileQueue$ProcessQueueConsumer.run(FileQueue.java:208)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
at java.lang.Thread.run(Thread.java:722)



 Comments   
Comment by Christian Schlichtherle [ 20/Oct/12 ]

The cause for this exception is invalid data in the Zip entry extra field.
This should have been a ZipException instead of an IndexOutOfBoundsExcepion.

Comment by Christian Schlichtherle [ 20/Nov/12 ]

The issue is still present if an extra field holds less than four bytes.

Comment by Christian Schlichtherle [ 21/Nov/12 ]

Changeset: 6ee0a5235e66
Author: Christian Schlichtherle <christian AT schlichtherle DOT de>
Date: 2012-11-21 12:17
Message: Fixed.
Issue #TRUEZIP-299 - CLONE -ArrayIndexOutOfBounds when reading an Extra field





Generated at Tue Jul 28 06:25:23 UTC 2015 using JIRA 6.2.3#6260-sha1:63ef1d6dac3f4f4d7db4c1effd405ba38ccdc558.