mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-27 06:45:07 +02:00
8277087: ZipException: zip END header not found at ZipFile#Source.findEND
Reviewed-by: lancea
This commit is contained in:
parent
12f08ba4d4
commit
e3243ee963
2 changed files with 117 additions and 3 deletions
|
@ -144,11 +144,14 @@ public class ZipOutputStream extends DeflaterOutputStream implements ZipConstant
|
|||
* ZIP file comment is greater than 0xFFFF bytes
|
||||
*/
|
||||
public void setComment(String comment) {
|
||||
byte[] bytes = null;
|
||||
if (comment != null) {
|
||||
this.comment = zc.getBytes(comment);
|
||||
if (this.comment.length > 0xffff)
|
||||
throw new IllegalArgumentException("ZIP file comment too long.");
|
||||
bytes = zc.getBytes(comment);
|
||||
if (bytes.length > 0xffff) {
|
||||
throw new IllegalArgumentException("ZIP file comment too long");
|
||||
}
|
||||
}
|
||||
this.comment = bytes;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue