Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
Suyu
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
many-archive
Suyu
Commits
b70c4fb4
There was an error fetching the commit references. Please try again later.
Commit
b70c4fb4
authored
10 years ago
by
bunnei
Browse files
Options
Downloads
Patches
Plain Diff
NCCH: Updated ExeFS memory allocation to be safer.
parent
542700cc
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/core/loader/loader.h
+1
-0
1 addition, 0 deletions
src/core/loader/loader.h
src/core/loader/ncch.cpp
+6
-1
6 additions, 1 deletion
src/core/loader/ncch.cpp
with
7 additions
and
1 deletion
src/core/loader/loader.h
+
1
−
0
View file @
b70c4fb4
...
@@ -32,6 +32,7 @@ enum class ResultStatus {
...
@@ -32,6 +32,7 @@ enum class ResultStatus {
ErrorNotLoaded
,
ErrorNotLoaded
,
ErrorNotUsed
,
ErrorNotUsed
,
ErrorAlreadyLoaded
,
ErrorAlreadyLoaded
,
ErrorMemoryAllocationFailed
,
};
};
/// Interface for loading an application
/// Interface for loading an application
...
...
This diff is collapsed.
Click to expand it.
src/core/loader/ncch.cpp
+
6
−
1
View file @
b70c4fb4
...
@@ -157,7 +157,12 @@ ResultStatus AppLoader_NCCH::LoadSectionExeFS(const char* name, std::vector<u8>&
...
@@ -157,7 +157,12 @@ ResultStatus AppLoader_NCCH::LoadSectionExeFS(const char* name, std::vector<u8>&
// Section is compressed...
// Section is compressed...
if
(
i
==
0
&&
is_compressed
)
{
if
(
i
==
0
&&
is_compressed
)
{
// Read compressed .code section...
// Read compressed .code section...
std
::
unique_ptr
<
u8
[]
>
temp_buffer
(
new
u8
[
exefs_header
.
section
[
i
].
size
]);
std
::
unique_ptr
<
u8
[]
>
temp_buffer
;
try
{
temp_buffer
.
reset
(
new
u8
[
exefs_header
.
section
[
i
].
size
]);
}
catch
(
std
::
bad_alloc
&
)
{
return
ResultStatus
::
ErrorMemoryAllocationFailed
;
}
file
.
ReadBytes
(
&
temp_buffer
[
0
],
exefs_header
.
section
[
i
].
size
);
file
.
ReadBytes
(
&
temp_buffer
[
0
],
exefs_header
.
section
[
i
].
size
);
// Decompress .code section...
// Decompress .code section...
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment