Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_hotspot
提交
e30df494
D
dragonwell8_hotspot
项目概览
openanolis
/
dragonwell8_hotspot
通知
2
Star
2
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
D
dragonwell8_hotspot
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
e30df494
编写于
2月 13, 2014
作者:
H
hseigel
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
8030763: Validate global memory allocation
Summary: Add length checks where necessary Reviewed-by: coleenp, mschoene
上级
dc4592a6
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
19 addition
and
39 deletion
+19
-39
src/os/bsd/vm/os_bsd.cpp
src/os/bsd/vm/os_bsd.cpp
+3
-6
src/os/linux/vm/os_linux.cpp
src/os/linux/vm/os_linux.cpp
+3
-5
src/os/solaris/vm/os_solaris.cpp
src/os/solaris/vm/os_solaris.cpp
+3
-5
src/os/windows/vm/os_windows.cpp
src/os/windows/vm/os_windows.cpp
+6
-16
src/share/vm/compiler/compileBroker.cpp
src/share/vm/compiler/compileBroker.cpp
+2
-1
src/share/vm/runtime/os.hpp
src/share/vm/runtime/os.hpp
+1
-4
src/share/vm/utilities/vmError.cpp
src/share/vm/utilities/vmError.cpp
+1
-2
未找到文件。
src/os/bsd/vm/os_bsd.cpp
浏览文件 @
e30df494
/*
* Copyright (c) 1999, 201
3
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1999, 201
4
, Oracle and/or its affiliates. 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
...
...
@@ -1115,10 +1115,6 @@ void os::die() {
::
abort
();
}
// unused on bsd for now.
void
os
::
set_error_file
(
const
char
*
logfile
)
{}
// This method is a copy of JDK's sysGetLastErrorString
// from src/solaris/hpi/src/system_md.c
...
...
@@ -1808,6 +1804,7 @@ void os::jvm_path(char *buf, jint buflen) {
// determine if this is a legacy image or modules image
// modules image doesn't have "jre" subdirectory
len
=
strlen
(
buf
);
assert
(
len
<
buflen
,
"Ran out of buffer space"
);
jrelib_p
=
buf
+
len
;
// Add the appropriate library subdir
...
...
@@ -1841,7 +1838,7 @@ void os::jvm_path(char *buf, jint buflen) {
}
}
str
cpy
(
saved_jvm_path
,
buf
);
str
ncpy
(
saved_jvm_path
,
buf
,
MAXPATHLEN
);
}
void
os
::
print_jni_name_prefix_on
(
outputStream
*
st
,
int
args_size
)
{
...
...
src/os/linux/vm/os_linux.cpp
浏览文件 @
e30df494
/*
* Copyright (c) 1999, 201
3
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1999, 201
4
, Oracle and/or its affiliates. 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
...
...
@@ -1572,9 +1572,6 @@ void os::die() {
::
abort
();
}
// unused on linux for now.
void
os
::
set_error_file
(
const
char
*
logfile
)
{}
// This method is a copy of JDK's sysGetLastErrorString
// from src/solaris/hpi/src/system_md.c
...
...
@@ -2399,6 +2396,7 @@ void os::jvm_path(char *buf, jint buflen) {
// determine if this is a legacy image or modules image
// modules image doesn't have "jre" subdirectory
len
=
strlen
(
buf
);
assert
(
len
<
buflen
,
"Ran out of buffer room"
);
jrelib_p
=
buf
+
len
;
snprintf
(
jrelib_p
,
buflen
-
len
,
"/jre/lib/%s"
,
cpu_arch
);
if
(
0
!=
access
(
buf
,
F_OK
))
{
...
...
@@ -2419,7 +2417,7 @@ void os::jvm_path(char *buf, jint buflen) {
}
}
str
cpy
(
saved_jvm_path
,
buf
);
str
ncpy
(
saved_jvm_path
,
buf
,
MAXPATHLEN
);
}
void
os
::
print_jni_name_prefix_on
(
outputStream
*
st
,
int
args_size
)
{
...
...
src/os/solaris/vm/os_solaris.cpp
浏览文件 @
e30df494
/*
* Copyright (c) 1997, 201
3
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 201
4
, Oracle and/or its affiliates. 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
...
...
@@ -1788,9 +1788,6 @@ void os::die() {
::
abort
();
// dump core (for debugging)
}
// unused
void
os
::
set_error_file
(
const
char
*
logfile
)
{}
// DLL functions
const
char
*
os
::
dll_file_extension
()
{
return
".so"
;
}
...
...
@@ -2474,6 +2471,7 @@ void os::jvm_path(char *buf, jint buflen) {
// determine if this is a legacy image or modules image
// modules image doesn't have "jre" subdirectory
len
=
strlen
(
buf
);
assert
(
len
<
buflen
,
"Ran out of buffer space"
);
jrelib_p
=
buf
+
len
;
snprintf
(
jrelib_p
,
buflen
-
len
,
"/jre/lib/%s"
,
cpu_arch
);
if
(
0
!=
access
(
buf
,
F_OK
))
{
...
...
@@ -2492,7 +2490,7 @@ void os::jvm_path(char *buf, jint buflen) {
}
}
str
cpy
(
saved_jvm_path
,
buf
);
str
ncpy
(
saved_jvm_path
,
buf
,
MAXPATHLEN
);
}
...
...
src/os/windows/vm/os_windows.cpp
浏览文件 @
e30df494
/*
* Copyright (c) 1997, 201
3
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 201
4
, Oracle and/or its affiliates. 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
...
...
@@ -1819,7 +1819,8 @@ void os::jvm_path(char *buf, jint buflen) {
// libjvm.so is installed there (append a fake suffix
// hotspot/libjvm.so).
char
*
java_home_var
=
::
getenv
(
"JAVA_HOME"
);
if
(
java_home_var
!=
NULL
&&
java_home_var
[
0
]
!=
0
)
{
if
(
java_home_var
!=
NULL
&&
java_home_var
[
0
]
!=
0
&&
strlen
(
java_home_var
)
<
(
size_t
)
buflen
)
{
strncpy
(
buf
,
java_home_var
,
buflen
);
...
...
@@ -1837,9 +1838,9 @@ void os::jvm_path(char *buf, jint buflen) {
}
if
(
buf
[
0
]
==
'\0'
)
{
GetModuleFileName
(
vm_lib_handle
,
buf
,
buflen
);
GetModuleFileName
(
vm_lib_handle
,
buf
,
buflen
);
}
str
cpy
(
saved_jvm_path
,
buf
);
str
ncpy
(
saved_jvm_path
,
buf
,
MAX_PATH
);
}
...
...
@@ -2290,19 +2291,8 @@ LONG WINAPI Handle_FLT_Exception(struct _EXCEPTION_POINTERS* exceptionInfo) {
}
*/
#endif //_WIN64
// Fatal error reporting is single threaded so we can make this a
// static and preallocated. If it's more than MAX_PATH silently ignore
// it.
static
char
saved_error_file
[
MAX_PATH
]
=
{
0
};
#endif // _WIN64
void
os
::
set_error_file
(
const
char
*
logfile
)
{
if
(
strlen
(
logfile
)
<=
MAX_PATH
)
{
strncpy
(
saved_error_file
,
logfile
,
MAX_PATH
);
}
}
static
inline
void
report_error
(
Thread
*
t
,
DWORD
exception_code
,
address
addr
,
void
*
siginfo
,
void
*
context
)
{
...
...
src/share/vm/compiler/compileBroker.cpp
浏览文件 @
e30df494
/*
* Copyright (c) 1999, 201
3
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1999, 201
4
, Oracle and/or its affiliates. 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
...
...
@@ -2089,6 +2089,7 @@ void CompileBroker::set_last_compile(CompilerThread* thread, methodHandle method
ResourceMark
rm
;
char
*
method_name
=
method
->
name
()
->
as_C_string
();
strncpy
(
_last_method_compiled
,
method_name
,
CompileBroker
::
name_buffer_length
);
_last_method_compiled
[
CompileBroker
::
name_buffer_length
-
1
]
=
'\0'
;
// ensure null terminated
char
current_method
[
CompilerCounters
::
cmname_buffer_length
];
size_t
maxLen
=
CompilerCounters
::
cmname_buffer_length
;
...
...
src/share/vm/runtime/os.hpp
浏览文件 @
e30df494
/*
* Copyright (c) 1997, 201
3
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 201
4
, Oracle and/or its affiliates. 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
...
...
@@ -470,9 +470,6 @@ class os: AllStatic {
// run cmd in a separate process and return its exit code; or -1 on failures
static
int
fork_and_exec
(
char
*
cmd
);
// Set file to send error reports.
static
void
set_error_file
(
const
char
*
logfile
);
// os::exit() is merged with vm_exit()
// static void exit(int num);
...
...
src/share/vm/utilities/vmError.cpp
浏览文件 @
e30df494
/*
* Copyright (c) 2003, 201
3
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2003, 201
4
, Oracle and/or its affiliates. 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
...
...
@@ -975,7 +975,6 @@ void VMError::report_and_die() {
if
(
fd
!=
-
1
)
{
out
.
print_raw
(
"# An error report file with more information is saved as:
\n
# "
);
out
.
print_raw_cr
(
buffer
);
os
::
set_error_file
(
buffer
);
log
.
set_fd
(
fd
);
}
else
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录