mirror of
https://github.com/openjdk/jdk.git
synced 2025-09-17 17:44:40 +02:00
8271987: Manifest improved manifest entries
Reviewed-by: rhalade, dholmes
This commit is contained in:
parent
5832a34404
commit
4be02d3155
1 changed files with 8 additions and 2 deletions
|
@ -303,13 +303,19 @@ u1* ClassPathZipEntry::open_entry(JavaThread* current, const char* name, jint* f
|
||||||
}
|
}
|
||||||
|
|
||||||
// read contents into resource array
|
// read contents into resource array
|
||||||
int size = (*filesize) + ((nul_terminate) ? 1 : 0);
|
size_t size = (uint32_t)(*filesize);
|
||||||
|
if (nul_terminate) {
|
||||||
|
if (sizeof(size) == sizeof(uint32_t) && size == UINT_MAX) {
|
||||||
|
return NULL; // 32-bit integer overflow will occur.
|
||||||
|
}
|
||||||
|
size++;
|
||||||
|
}
|
||||||
buffer = NEW_RESOURCE_ARRAY(u1, size);
|
buffer = NEW_RESOURCE_ARRAY(u1, size);
|
||||||
if (!(*ReadEntry)(_zip, entry, buffer, filename)) return NULL;
|
if (!(*ReadEntry)(_zip, entry, buffer, filename)) return NULL;
|
||||||
|
|
||||||
// return result
|
// return result
|
||||||
if (nul_terminate) {
|
if (nul_terminate) {
|
||||||
buffer[*filesize] = 0;
|
buffer[size - 1] = 0;
|
||||||
}
|
}
|
||||||
return buffer;
|
return buffer;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue