Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_jdk
提交
5369f5f2
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看板
提交
5369f5f2
编写于
6月 11, 2015
作者:
M
mfang
浏览文件
操作
浏览文件
下载
差异文件
Merge
上级
34f42b77
b5b9ff7e
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
110 addition
and
31 deletion
+110
-31
.hgtags
.hgtags
+1
-0
src/share/classes/sun/nio/cs/ext/HKSCS.java
src/share/classes/sun/nio/cs/ext/HKSCS.java
+0
-1
src/solaris/native/java/net/Inet4AddressImpl.c
src/solaris/native/java/net/Inet4AddressImpl.c
+13
-12
src/solaris/native/java/net/Inet6AddressImpl.c
src/solaris/native/java/net/Inet6AddressImpl.c
+20
-17
test/javax/xml/jaxp/testng/parse/jdk7156085/UTF8ReaderBug.java
...javax/xml/jaxp/testng/parse/jdk7156085/UTF8ReaderBug.java
+64
-0
test/sun/nio/cs/TestStringCoding.java
test/sun/nio/cs/TestStringCoding.java
+12
-1
未找到文件。
.hgtags
浏览文件 @
5369f5f2
...
...
@@ -417,3 +417,4 @@ bdcb84f205482c7aea48a1403e843f5fd689d849 jdk8u60-b11
a006fa0a9e8f18dee6daf8984bd11625c4c4860c jdk8u60-b15
6ed3821c212a93ffc6bfcc292ef7aca3b7165139 jdk8u60-b16
c30db4c968f63dce1bf2f9df240fb75a8f27f922 jdk8u60-b17
57336c319de8a141d0bcd04265ce36734fb51380 jdk8u60-b18
src/share/classes/sun/nio/cs/ext/HKSCS.java
浏览文件 @
5369f5f2
...
...
@@ -377,7 +377,6 @@ public class HKSCS {
dst
[
dp
++]
=
repl
[
1
];
continue
;
}
sp
++;
}
if
(
bb
>
MAX_SINGLEBYTE
)
{
// DoubleByte
dst
[
dp
++]
=
(
byte
)(
bb
>>
8
);
...
...
src/solaris/native/java/net/Inet4AddressImpl.c
浏览文件 @
5369f5f2
...
...
@@ -144,7 +144,7 @@ Java_java_net_Inet4AddressImpl_lookupAllHostAddr(JNIEnv *env, jobject this,
jobjectArray
ret
=
0
;
int
retLen
=
0
;
int
error
=
0
;
int
getaddrinfo_
error
=
0
;
struct
addrinfo
hints
,
*
res
,
*
resNew
=
NULL
;
if
(
!
initializeInetClasses
(
env
))
...
...
@@ -172,22 +172,23 @@ Java_java_net_Inet4AddressImpl_lookupAllHostAddr(JNIEnv *env, jobject this,
return
NULL
;
}
getaddrinfo_error
=
getaddrinfo
(
hostname
,
NULL
,
&
hints
,
&
res
);
#ifdef MACOSX
/* If we're looking up the local machine, bypass DNS lookups and get
* address from
getifaddrs.
*/
ret
=
lookupIfLocalhost
(
env
,
hostname
,
JNI_FALSE
);
if
(
ret
!=
NULL
||
(
*
env
)
->
ExceptionCheck
(
env
))
{
JNU_ReleaseStringPlatformChars
(
env
,
host
,
hostname
)
;
return
ret
;
if
(
getaddrinfo_error
)
{
// If getaddrinfo fails try
getifaddrs.
ret
=
lookupIfLocalhost
(
env
,
hostname
,
JNI_FALSE
);
if
(
ret
!=
NULL
||
(
*
env
)
->
ExceptionCheck
(
env
))
{
JNU_ReleaseStringPlatformChars
(
env
,
host
,
hostname
);
return
ret
;
}
}
#endif
error
=
getaddrinfo
(
hostname
,
NULL
,
&
hints
,
&
res
);
if
(
error
)
{
if
(
getaddrinfo_error
)
{
/* report error */
ThrowUnknownHostExceptionWithGaiError
(
env
,
hostname
,
error
);
ThrowUnknownHostExceptionWithGaiError
(
env
,
hostname
,
getaddrinfo_error
);
JNU_ReleaseStringPlatformChars
(
env
,
host
,
hostname
);
return
NULL
;
}
else
{
...
...
src/solaris/native/java/net/Inet6AddressImpl.c
浏览文件 @
5369f5f2
...
...
@@ -296,7 +296,7 @@ Java_java_net_Inet6AddressImpl_lookupAllHostAddr(JNIEnv *env, jobject this,
jobjectArray
ret
=
0
;
int
retLen
=
0
;
int
error
=
0
;
int
getaddrinfo_
error
=
0
;
#ifdef AF_INET6
struct
addrinfo
hints
,
*
res
,
*
resNew
=
NULL
;
#endif
/* AF_INET6 */
...
...
@@ -311,19 +311,6 @@ Java_java_net_Inet6AddressImpl_lookupAllHostAddr(JNIEnv *env, jobject this,
hostname
=
JNU_GetStringPlatformChars
(
env
,
host
,
JNI_FALSE
);
CHECK_NULL_RETURN
(
hostname
,
NULL
);
#ifdef MACOSX
/*
* If we're looking up the local machine, attempt to get the address
* from getifaddrs. This ensures we get an IPv6 address for the local
* machine.
*/
ret
=
lookupIfLocalhost
(
env
,
hostname
,
JNI_TRUE
);
if
(
ret
!=
NULL
||
(
*
env
)
->
ExceptionCheck
(
env
))
{
JNU_ReleaseStringPlatformChars
(
env
,
host
,
hostname
);
return
ret
;
}
#endif
#ifdef AF_INET6
/* Try once, with our static buffer. */
memset
(
&
hints
,
0
,
sizeof
(
hints
));
...
...
@@ -343,11 +330,27 @@ Java_java_net_Inet6AddressImpl_lookupAllHostAddr(JNIEnv *env, jobject this,
}
#endif
error
=
getaddrinfo
(
hostname
,
NULL
,
&
hints
,
&
res
);
getaddrinfo_error
=
getaddrinfo
(
hostname
,
NULL
,
&
hints
,
&
res
);
#ifdef MACOSX
if
(
getaddrinfo_error
)
{
/*
* If getaddrinfo fails looking up the local machine, attempt to get the
* address from getifaddrs. This ensures we get an IPv6 address for the
* local machine.
*/
ret
=
lookupIfLocalhost
(
env
,
hostname
,
JNI_TRUE
);
if
(
ret
!=
NULL
||
(
*
env
)
->
ExceptionCheck
(
env
))
{
JNU_ReleaseStringPlatformChars
(
env
,
host
,
hostname
);
return
ret
;
}
}
#endif
if
(
error
)
{
if
(
getaddrinfo_
error
)
{
/* report error */
ThrowUnknownHostExceptionWithGaiError
(
env
,
hostname
,
error
);
ThrowUnknownHostExceptionWithGaiError
(
env
,
hostname
,
getaddrinfo_error
);
JNU_ReleaseStringPlatformChars
(
env
,
host
,
hostname
);
return
NULL
;
}
else
{
...
...
test/javax/xml/jaxp/testng/parse/jdk7156085/UTF8ReaderBug.java
0 → 100644
浏览文件 @
5369f5f2
/*
* Copyright 2014 Google, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package
parse.jdk7156085
;
import
java.io.ByteArrayInputStream
;
import
java.io.IOException
;
import
javax.xml.parsers.SAXParser
;
import
javax.xml.parsers.SAXParserFactory
;
import
org.xml.sax.InputSource
;
import
org.xml.sax.helpers.DefaultHandler
;
import
org.testng.annotations.Test
;
/**
* JDK-7156085: ArrayIndexOutOfBoundsException throws in UTF8Reader of SAXParser
* https://bugs.openjdk.java.net/browse/JDK-7156085
*
* XERCESJ-1257: buffer overflow in UTF8Reader for characters out of BMP
* https://issues.apache.org/jira/browse/XERCESJ-1257
*/
public
class
UTF8ReaderBug
{
@Test
public
void
shouldAcceptSupplementaryCharacters
()
throws
Throwable
{
StringBuilder
b
=
new
StringBuilder
(
"<xml>"
);
for
(
int
i
=
5
;
i
<
8223
;
i
++)
{
b
.
append
(
' '
);
}
// Add surrogate characters which overflow the buffer. This shows the need to place an
// overflow check at --
// com.sun.org.apache.xerces.internal.impl.io.UTF8Reader.read(UTF8Reader.java:544)
b
.
append
(
"\uD835\uDC37"
);
b
.
append
(
"</xml>"
);
sendToParser
(
b
.
toString
());
}
private
static
void
sendToParser
(
String
b
)
throws
Throwable
{
byte
[]
input
=
b
.
getBytes
(
"UTF-8"
);
ByteArrayInputStream
in
=
new
ByteArrayInputStream
(
input
);
SAXParserFactory
spf
=
SAXParserFactory
.
newInstance
();
SAXParser
p
=
spf
.
newSAXParser
();
p
.
parse
(
new
InputSource
(
in
),
new
DefaultHandler
());
}
}
test/sun/nio/cs/TestStringCoding.java
浏览文件 @
5369f5f2
...
...
@@ -22,7 +22,7 @@
*/
/* @test
@bug 6636323 6636319 7040220 7096080 7183053
@bug 6636323 6636319 7040220 7096080 7183053
8080248
@summary Test if StringCoding and NIO result have the same de/encoding result
* @run main/othervm/timeout=2000 TestStringCoding
*/
...
...
@@ -199,6 +199,17 @@ public class TestStringCoding {
*/
}
//encode mappable surrogates for hkscs
if
(
cs
.
name
().
equals
(
"Big5-HKSCS"
)
||
cs
.
name
().
equals
(
"x-MS950-HKSCS"
))
{
String
str
=
"ab\uD840\uDD0Ccd"
;
byte
[]
expected
=
new
byte
[]
{(
byte
)
'a'
,
(
byte
)
'b'
,
(
byte
)
0x88
,
(
byte
)
0x45
,
(
byte
)
'c'
,
(
byte
)
'd'
};
if
(!
Arrays
.
equals
(
str
.
getBytes
(
cs
.
name
()),
expected
)
||
!
Arrays
.
equals
(
str
.
getBytes
(
cs
),
expected
))
{
throw
new
RuntimeException
(
"encode(surrogates) failed -> "
+
cs
.
name
());
}
}
}
static
class
PermissiveSecurityManger
extends
SecurityManager
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录