Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_jdk
提交
bf131af4
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看板
体验新版 GitCode,发现更多精彩内容 >>
提交
bf131af4
编写于
2月 17, 2010
作者:
B
bae
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
6914823: Java AWT Library Invalid Index Vulnerability
Reviewed-by: flar, hawtin
上级
a43b165b
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
60 addition
and
2 deletion
+60
-2
src/share/classes/sun/awt/image/ImageRepresentation.java
src/share/classes/sun/awt/image/ImageRepresentation.java
+60
-2
未找到文件。
src/share/classes/sun/awt/image/ImageRepresentation.java
浏览文件 @
bf131af4
...
...
@@ -333,10 +333,10 @@ public class ImageRepresentation extends ImageWatched implements ImageConsumer
hints
=
h
;
}
p
ublic
native
void
setICMpixels
(
int
x
,
int
y
,
int
w
,
int
h
,
int
[]
lut
,
p
rivate
native
void
setICMpixels
(
int
x
,
int
y
,
int
w
,
int
h
,
int
[]
lut
,
byte
[]
pix
,
int
off
,
int
scansize
,
IntegerComponentRaster
ict
);
p
ublic
native
int
setDiffICM
(
int
x
,
int
y
,
int
w
,
int
h
,
int
[]
lut
,
p
rivate
native
int
setDiffICM
(
int
x
,
int
y
,
int
w
,
int
h
,
int
[]
lut
,
int
transPix
,
int
numLut
,
IndexColorModel
icm
,
byte
[]
pix
,
int
off
,
int
scansize
,
ByteComponentRaster
bct
,
int
chanOff
);
...
...
@@ -361,6 +361,64 @@ public class ImageRepresentation extends ImageWatched implements ImageConsumer
}
createBufferedImage
();
}
if
(
w
<=
0
||
h
<=
0
)
{
return
;
}
int
biWidth
=
biRaster
.
getWidth
();
int
biHeight
=
biRaster
.
getHeight
();
int
x1
=
x
+
w
;
// Overflow protection below
int
y1
=
y
+
h
;
// Overflow protection below
if
(
x
<
0
)
{
off
-=
x
;
x
=
0
;
}
else
if
(
x1
<
0
)
{
x1
=
biWidth
;
// Must be overflow
}
if
(
y
<
0
)
{
off
-=
y
*
scansize
;
y
=
0
;
}
else
if
(
y1
<
0
)
{
y1
=
biHeight
;
// Must be overflow
}
if
(
x1
>
biWidth
)
{
x1
=
biWidth
;
}
if
(
y1
>
biHeight
)
{
y1
=
biHeight
;
}
if
(
x
>=
x1
||
y
>=
y1
)
{
return
;
}
// x,y,x1,y1 are all >= 0, so w,h must be >= 0
w
=
x1
-
x
;
h
=
y1
-
y
;
// off is first pixel read so it must be in bounds
if
(
off
<
0
||
off
>=
pix
.
length
)
{
// They overflowed their own array
throw
new
ArrayIndexOutOfBoundsException
(
"Data offset out of bounds."
);
}
// pix.length and off are >= 0 so remainder >= 0
int
remainder
=
pix
.
length
-
off
;
if
(
remainder
<
w
)
{
// They overflowed their own array
throw
new
ArrayIndexOutOfBoundsException
(
"Data array is too short."
);
}
int
num
;
if
(
scansize
<
0
)
{
num
=
(
off
/
-
scansize
)
+
1
;
}
else
if
(
scansize
>
0
)
{
num
=
((
remainder
-
w
)
/
scansize
)
+
1
;
}
else
{
num
=
h
;
}
if
(
h
>
num
)
{
// They overflowed their own array.
throw
new
ArrayIndexOutOfBoundsException
(
"Data array is too short."
);
}
if
(
isSameCM
&&
(
cmodel
!=
model
)
&&
(
srcLUT
!=
null
)
&&
(
model
instanceof
IndexColorModel
)
&&
(
biRaster
instanceof
ByteComponentRaster
))
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录