Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_jdk
提交
5cc024d8
D
dragonwell8_jdk
项目概览
openanolis
/
dragonwell8_jdk
通知
4
Star
2
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
D
dragonwell8_jdk
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
5cc024d8
编写于
9月 19, 2012
作者:
W
weijun
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
8000210: Improve JarFile code quality
Reviewed-by: ahgross, xuelei, mschoene
上级
b501a9be
变更
2
显示空白变更内容
内联
并排
Showing
2 changed file
with
15 addition
and
10 deletion
+15
-10
src/share/classes/java/util/jar/JarFile.java
src/share/classes/java/util/jar/JarFile.java
+11
-10
src/share/classes/sun/security/util/DerIndefLenConverter.java
...share/classes/sun/security/util/DerIndefLenConverter.java
+4
-0
未找到文件。
src/share/classes/java/util/jar/JarFile.java
浏览文件 @
5cc024d8
...
@@ -34,6 +34,7 @@ import java.security.CodeSigner;
...
@@ -34,6 +34,7 @@ import java.security.CodeSigner;
import
java.security.cert.Certificate
;
import
java.security.cert.Certificate
;
import
java.security.AccessController
;
import
java.security.AccessController
;
import
java.security.CodeSource
;
import
java.security.CodeSource
;
import
sun.misc.IOUtils
;
import
sun.security.action.GetPropertyAction
;
import
sun.security.action.GetPropertyAction
;
import
sun.security.util.ManifestEntryVerifier
;
import
sun.security.util.ManifestEntryVerifier
;
import
sun.misc.SharedSecrets
;
import
sun.misc.SharedSecrets
;
...
@@ -329,6 +330,9 @@ class JarFile extends ZipFile {
...
@@ -329,6 +330,9 @@ class JarFile extends ZipFile {
if
(
names
!=
null
)
{
if
(
names
!=
null
)
{
for
(
int
i
=
0
;
i
<
names
.
length
;
i
++)
{
for
(
int
i
=
0
;
i
<
names
.
length
;
i
++)
{
JarEntry
e
=
getJarEntry
(
names
[
i
]);
JarEntry
e
=
getJarEntry
(
names
[
i
]);
if
(
e
==
null
)
{
throw
new
JarException
(
"corrupted jar file"
);
}
if
(!
e
.
isDirectory
())
{
if
(!
e
.
isDirectory
())
{
if
(
mev
==
null
)
{
if
(
mev
==
null
)
{
mev
=
new
ManifestEntryVerifier
mev
=
new
ManifestEntryVerifier
...
@@ -348,6 +352,10 @@ class JarFile extends ZipFile {
...
@@ -348,6 +352,10 @@ class JarFile extends ZipFile {
// treat the jar file as being unsigned
// treat the jar file as being unsigned
jv
=
null
;
jv
=
null
;
verify
=
false
;
verify
=
false
;
if
(
JarVerifier
.
debug
!=
null
)
{
JarVerifier
.
debug
.
println
(
"jarfile parsing error!"
);
ex
.
printStackTrace
();
}
}
}
// if after initializing the verifier we have nothing
// if after initializing the verifier we have nothing
...
@@ -375,11 +383,9 @@ class JarFile extends ZipFile {
...
@@ -375,11 +383,9 @@ class JarFile extends ZipFile {
* META-INF files.
* META-INF files.
*/
*/
private
byte
[]
getBytes
(
ZipEntry
ze
)
throws
IOException
{
private
byte
[]
getBytes
(
ZipEntry
ze
)
throws
IOException
{
byte
[]
b
=
new
byte
[(
int
)
ze
.
getSize
()];
try
(
InputStream
is
=
super
.
getInputStream
(
ze
))
{
try
(
DataInputStream
is
=
new
DataInputStream
(
super
.
getInputStream
(
ze
)))
{
return
IOUtils
.
readFully
(
is
,
(
int
)
ze
.
getSize
(),
true
);
is
.
readFully
(
b
,
0
,
b
.
length
);
}
}
return
b
;
}
}
/**
/**
...
@@ -479,12 +485,7 @@ class JarFile extends ZipFile {
...
@@ -479,12 +485,7 @@ class JarFile extends ZipFile {
if
(!
isKnownToNotHaveClassPathAttribute
())
{
if
(!
isKnownToNotHaveClassPathAttribute
())
{
JarEntry
manEntry
=
getManEntry
();
JarEntry
manEntry
=
getManEntry
();
if
(
manEntry
!=
null
)
{
if
(
manEntry
!=
null
)
{
byte
[]
b
=
new
byte
[(
int
)
manEntry
.
getSize
()];
byte
[]
b
=
getBytes
(
manEntry
);
try
(
DataInputStream
dis
=
new
DataInputStream
(
super
.
getInputStream
(
manEntry
)))
{
dis
.
readFully
(
b
,
0
,
b
.
length
);
}
int
last
=
b
.
length
-
src
.
length
;
int
last
=
b
.
length
-
src
.
length
;
int
i
=
0
;
int
i
=
0
;
next:
next:
...
...
src/share/classes/sun/security/util/DerIndefLenConverter.java
浏览文件 @
5cc024d8
...
@@ -325,6 +325,10 @@ class DerIndefLenConverter {
...
@@ -325,6 +325,10 @@ class DerIndefLenConverter {
}
}
}
}
if
(
unresolved
!=
0
)
{
throw
new
IOException
(
"not all indef len BER resolved"
);
}
newData
=
new
byte
[
dataSize
+
numOfTotalLenBytes
+
unused
];
newData
=
new
byte
[
dataSize
+
numOfTotalLenBytes
+
unused
];
dataPos
=
0
;
newDataPos
=
0
;
index
=
0
;
dataPos
=
0
;
newDataPos
=
0
;
index
=
0
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录