mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-26 06:14:49 +02:00
8030763: Validate global memory allocation
Add length checks where necessary Reviewed-by: coleenp, mschoene
This commit is contained in:
parent
5323c1c179
commit
7ec22758dc
7 changed files with 11 additions and 30 deletions
|
@ -1172,10 +1172,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
|
||||
|
||||
|
@ -1832,6 +1828,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
|
||||
|
@ -1865,7 +1862,7 @@ void os::jvm_path(char *buf, jint buflen) {
|
|||
}
|
||||
}
|
||||
|
||||
strcpy(saved_jvm_path, buf);
|
||||
strncpy(saved_jvm_path, buf, MAXPATHLEN);
|
||||
}
|
||||
|
||||
void os::print_jni_name_prefix_on(outputStream* st, int args_size) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue