Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_jdk
提交
198c02c6
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看板
提交
198c02c6
编写于
10月 30, 2010
作者:
B
bae
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
6985453: Font.createFont may expose some system properties in exception text
Reviewed-by: prr, hawtin
上级
7ff04ffb
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
52 addition
and
16 deletion
+52
-16
src/share/classes/sun/font/FileFont.java
src/share/classes/sun/font/FileFont.java
+48
-12
src/share/classes/sun/font/TrueTypeFont.java
src/share/classes/sun/font/TrueTypeFont.java
+3
-3
src/share/classes/sun/font/Type1Font.java
src/share/classes/sun/font/Type1Font.java
+1
-1
未找到文件。
src/share/classes/sun/font/FileFont.java
浏览文件 @
198c02c6
...
...
@@ -32,22 +32,13 @@ import java.awt.geom.Point2D;
import
java.awt.geom.Rectangle2D
;
import
java.io.File
;
import
java.nio.ByteBuffer
;
import
java.nio.channels.FileChannel
;
import
sun.java2d.Disposer
;
import
sun.java2d.DisposerRecord
;
import
java.lang.ref.WeakReference
;
import
java.io.FileNotFoundException
;
import
java.io.IOException
;
import
java.io.RandomAccessFile
;
import
java.io.UnsupportedEncodingException
;
import
java.nio.ByteOrder
;
import
java.nio.MappedByteBuffer
;
import
java.nio.BufferUnderflowException
;
import
java.nio.channels.ClosedChannelException
;
import
java.util.HashSet
;
import
java.util.HashMap
;
import
java.awt.Font
;
import
java.security.AccessController
;
import
java.security.PrivilegedActionException
;
import
java.security.PrivilegedExceptionAction
;
public
abstract
class
FileFont
extends
PhysicalFont
{
...
...
@@ -286,4 +277,49 @@ public abstract class FileFont extends PhysicalFont {
});
}
}
protected
String
getPublicFileName
()
{
SecurityManager
sm
=
System
.
getSecurityManager
();
if
(
sm
==
null
)
{
return
platName
;
}
boolean
canReadProperty
=
true
;
try
{
sm
.
checkPropertyAccess
(
"java.io.tmpdir"
);
}
catch
(
SecurityException
e
)
{
canReadProperty
=
false
;
}
if
(
canReadProperty
)
{
return
platName
;
}
final
File
f
=
new
File
(
platName
);
Boolean
isTmpFile
=
Boolean
.
FALSE
;
try
{
isTmpFile
=
AccessController
.
doPrivileged
(
new
PrivilegedExceptionAction
<
Boolean
>()
{
public
Boolean
run
()
{
File
tmp
=
new
File
(
System
.
getProperty
(
"java.io.tmpdir"
));
try
{
String
tpath
=
tmp
.
getCanonicalPath
();
String
fpath
=
f
.
getCanonicalPath
();
return
(
fpath
==
null
)
||
fpath
.
startsWith
(
tpath
);
}
catch
(
IOException
e
)
{
return
Boolean
.
TRUE
;
}
}
}
);
}
catch
(
PrivilegedActionException
e
)
{
// unable to verify whether value of java.io.tempdir will be
// exposed, so return only a name of the font file.
isTmpFile
=
Boolean
.
TRUE
;
}
return
isTmpFile
?
"temp file"
:
platName
;
}
}
src/share/classes/sun/font/TrueTypeFont.java
浏览文件 @
198c02c6
...
...
@@ -519,7 +519,8 @@ public class TrueTypeFont extends FileFont {
break
;
default
:
throw
new
FontFormatException
(
"Unsupported sfnt "
+
platName
);
throw
new
FontFormatException
(
"Unsupported sfnt "
+
getPublicFileName
());
}
/* Now have the offset of this TT font (possibly within a TTC)
...
...
@@ -1680,7 +1681,6 @@ public class TrueTypeFont extends FileFont {
@Override
public
String
toString
()
{
return
"** TrueType Font: Family="
+
familyName
+
" Name="
+
fullName
+
" style="
+
style
+
" fileName="
+
platName
;
" style="
+
style
+
" fileName="
+
getPublicFileName
()
;
}
}
src/share/classes/sun/font/Type1Font.java
浏览文件 @
198c02c6
...
...
@@ -677,6 +677,6 @@ public class Type1Font extends FileFont {
public
String
toString
()
{
return
"** Type1 Font: Family="
+
familyName
+
" Name="
+
fullName
+
" style="
+
style
+
" fileName="
+
platName
;
" style="
+
style
+
" fileName="
+
getPublicFileName
()
;
}
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录