This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
Summary: | Buffer overflow in NbInstaller | ||
---|---|---|---|
Product: | platform | Reporter: | _ ttran <ttran> |
Component: | Module System | Assignee: | Jesse Glick <jglick> |
Status: | VERIFIED FIXED | ||
Severity: | blocker | ||
Priority: | P2 | ||
Version: | 3.x | ||
Hardware: | PC | ||
OS: | Other | ||
Issue Type: | DEFECT | Exception Reporter: | |
Bug Depends on: | |||
Bug Blocks: | 26786 |
Description
_ ttran
2002-11-14 16:35:16 UTC
Strange... the code was originally (1.47) supposed to be written to support any size manifest, of course, but there was a logic bug which was found quickly by someone with a bigger manifest (activation.jar as I recall) and then corrected (1.48). On what platform do you get this? How was it observed? Writing a unit test... Works for me with the original code (before your buffer size increase), using 1. a small manifest 2. a bigger one (> 4k) 3. an even bigger one (about 10k) So the unit test (which I will commit soon) says. If you have any more info on how to reproduce, I will add it to the test of course. Trung I will roll back your "hot patch" in the absence of any information on why you thought it was needed. 4k was chosen as a buffer size large enough to capture most manifests in their entirety without allocating too large a buffer. If a manifest exceeds that limit the buffer is expanded until it will fit. wait, it happens in Dublin build when NbInstaller loads manifest cache entry for activation.jar. If you want I can investigate it further Well, I personally saw an EOFException on Trung's machine, but I cannot reproduce on my own: 1. Made a full EE English build. 2. Ran it with a fresh user dir. JDK 1.4.1, Linux kernel 2.4.18, userdir filesystem = RAM disk. 3. Shut down, restarted. 4. No exception or obvious problem. 5. all-manifests.dat definitely contains entry for activation.jar, as well as for the much longer mail.jar. I will try to rewrite the code to make it simpler anyway. However I will not be able to confirm that the rewrite fixes anything, since I cannot reproduce the original problem. I rewrote the code to use an in-memory byte array, which is probably about the same speed, definitely simpler to read, hopefully more robust. The same unit test passes. Tried with S1S EE, seemed OK. committed * Up-To-Date 1.59 core/src/org/netbeans/core/modules/NbInstaller.java added * Up-To-Date 1.1 core/test/unit/src/org/netbeans/core/modules/NbInstallerTest9.java committed * Up-To-Date 1.16 core/test/unit/src/org/netbeans/core/modules/build.xml added * Up-To-Date 1.1 core/test/unit/src/org/netbeans/core/modules/jars/big-manifest.mf added * Up-To-Date 1.1 core/test/unit/src/org/netbeans/core/modules/jars/little-manifest.mf added * Up-To-Date 1.1 core/test/unit/src/org/netbeans/core/modules/jars/medium-manifest.mf verified |