| Summary: | SignatureBlockProcessor.readIntoArray(BundleEntry) does not close input stream | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| Product: | [Eclipse Project] Equinox | Reporter: | Pascal Rapicault <pascal> | ||||||
| Component: | Framework | Assignee: | Thomas Watson <tjwatson> | ||||||
| Status: | RESOLVED FIXED | QA Contact: | |||||||
| Severity: | critical | ||||||||
| Priority: | P3 | CC: | david_williams, mknauer, stephan.herrmann | ||||||
| Version: | 3.7 | ||||||||
| Target Milestone: | Juno M1 | ||||||||
| Hardware: | PC | ||||||||
| OS: | Mac OS X - Carbon (unsup.) | ||||||||
| Whiteboard: | |||||||||
| Bug Depends on: | |||||||||
| Bug Blocks: | 349192 | ||||||||
| Attachments: |
|
||||||||
|
Description
Pascal Rapicault
Created attachment 197885 [details]
patch
Thanks for the find Stephan! I released a fix to HEAD. I will open a separate bug to fix for Indigo SR1. fixed. (In reply to comment #2) > Thanks for the find Stephan! welcome :) > I released a fix to HEAD. Regarding your patch: Are you sure "is" will *never* be null? Would be a pity if the method throws just during cleanup, no? I seem to see implementors of BundleEntry.getInputStream() that can indeed return null. Also: how about IOException during close? Just wondering.. Created attachment 197886 [details] updated patch (In reply to comment #4) > (In reply to comment #2) > > Thanks for the find Stephan! > > welcome :) > > > I released a fix to HEAD. > > Regarding your patch: Are you sure "is" will *never* be null? BundleEntry object should never return null here. An IOException must be thrown if the entry cannot produce an InputStream. > Would be a pity if the method throws just during cleanup, no? > I seem to see implementors of BundleEntry.getInputStream() > that can indeed return null. Which implementors? I found DirZipBundleEntry returned null, incorrectly and is fixed in this patch. Are there others? > Also: how about IOException during close? > Just wondering.. Here is an update patch that catches the exception on close. (In reply to comment #5) > > Regarding your patch: Are you sure "is" will *never* be null? > > BundleEntry object should never return null here. An IOException must be > thrown if the entry cannot produce an InputStream. Great, so we know what *should* happen. > > Would be a pity if the method throws just during cleanup, no? > > I seem to see implementors of BundleEntry.getInputStream() > > that can indeed return null. > > Which implementors? I found DirZipBundleEntry returned null, incorrectly and > is fixed in this patch. Are there others? Actually ZipBundleEntry returns ZipFile.getInputStream() which is "internally documented" to return null for non-existing entries (when looking at JDK < 1.7: via the private getInputStream(String)) (In reply to comment #6) > > Actually ZipBundleEntry returns ZipFile.getInputStream() which is > "internally documented" to return null for non-existing entries > (when looking at JDK < 1.7: via the private getInputStream(String)) This should not happen since we only construct ZipBundleEntry objects after confirming that the entry actually exists in the ZipFile. FYI, the latest patch was released. I am reluctant to do any null checks for inputstreams here since we make the assumption all over in the framework that null is never returned here. |