提交 f20adc24 编写于 作者: K ksrini

7200500: Launcher better input validation

Reviewed-by: darcy, jjh, mschoene
上级 3517a050
...@@ -568,9 +568,9 @@ JLI_ParseManifest(char *jarfile, manifest_info *info) ...@@ -568,9 +568,9 @@ JLI_ParseManifest(char *jarfile, manifest_info *info)
#ifdef O_BINARY #ifdef O_BINARY
| O_BINARY /* use binary mode on windows */ | O_BINARY /* use binary mode on windows */
#endif #endif
)) == -1) )) == -1) {
return (-1); return (-1);
}
info->manifest_version = NULL; info->manifest_version = NULL;
info->main_class = NULL; info->main_class = NULL;
info->jre_version = NULL; info->jre_version = NULL;
...@@ -617,12 +617,14 @@ JLI_JarUnpackFile(const char *jarfile, const char *filename, int *size) { ...@@ -617,12 +617,14 @@ JLI_JarUnpackFile(const char *jarfile, const char *filename, int *size) {
zentry entry; zentry entry;
void *data = NULL; void *data = NULL;
fd = open(jarfile, O_RDONLY if ((fd = open(jarfile, O_RDONLY
#ifdef O_BINARY #ifdef O_BINARY
| O_BINARY /* use binary mode on windows */ | O_BINARY /* use binary mode on windows */
#endif #endif
); )) == -1) {
if (fd != -1 && find_file(fd, &entry, filename) == 0) { return NULL;
}
if (find_file(fd, &entry, filename) == 0) {
data = inflate_file(fd, &entry, size); data = inflate_file(fd, &entry, size);
} }
close(fd); close(fd);
...@@ -664,8 +666,9 @@ JLI_ManifestIterate(const char *jarfile, attribute_closure ac, void *user_data) ...@@ -664,8 +666,9 @@ JLI_ManifestIterate(const char *jarfile, attribute_closure ac, void *user_data)
#ifdef O_BINARY #ifdef O_BINARY
| O_BINARY /* use binary mode on windows */ | O_BINARY /* use binary mode on windows */
#endif #endif
)) == -1) )) == -1) {
return (-1); return (-1);
}
if (rc = find_file(fd, &entry, manifest_name) != 0) { if (rc = find_file(fd, &entry, manifest_name) != 0) {
close(fd); close(fd);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册