Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
M
Magisk
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
Magisk
Commits
7357a35f
Commit
7357a35f
authored
Aug 07, 2022
by
topjohnwu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix build errors
parent
aeb7fd7c
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
1 deletion
+6
-1
fortify.hpp
native/src/base/compat/fortify.hpp
+5
-0
files.cpp
native/src/base/files.cpp
+1
-1
No files found.
native/src/base/compat/fortify.hpp
View file @
7357a35f
...
@@ -26,6 +26,11 @@ static inline void __check_buffer_access(const char* fn, const char* action,
...
@@ -26,6 +26,11 @@ static inline void __check_buffer_access(const char* fn, const char* action,
__fortify_fatal
(
"%s: prevented %zu-byte %s %zu-byte buffer"
,
fn
,
claim
,
action
,
actual
);
__fortify_fatal
(
"%s: prevented %zu-byte %s %zu-byte buffer"
,
fn
,
claim
,
action
,
actual
);
}
}
}
}
void
*
__memcpy_chk
(
void
*
dst
,
const
void
*
src
,
size_t
count
,
size_t
dst_len
)
{
__check_count
(
"memcpy"
,
"count"
,
count
);
__check_buffer_access
(
"memcpy"
,
"write into"
,
count
,
dst_len
);
return
__call_bypassing_fortify
(
memcpy
)(
dst
,
src
,
count
);
}
char
*
__strcpy_chk
(
char
*
dst
,
const
char
*
src
,
size_t
dst_len
)
{
char
*
__strcpy_chk
(
char
*
dst
,
const
char
*
src
,
size_t
dst_len
)
{
// TODO: optimize so we don't scan src twice.
// TODO: optimize so we don't scan src twice.
size_t
src_len
=
__builtin_strlen
(
src
)
+
1
;
size_t
src_len
=
__builtin_strlen
(
src
)
+
1
;
...
...
native/src/base/files.cpp
View file @
7357a35f
...
@@ -440,7 +440,7 @@ void restore_folder(const char *dir, vector<raw_file> &files) {
...
@@ -440,7 +440,7 @@ void restore_folder(const char *dir, vector<raw_file> &files) {
for
(
raw_file
&
file
:
files
)
{
for
(
raw_file
&
file
:
files
)
{
string
path
=
base
+
"/"
+
file
.
path
;
string
path
=
base
+
"/"
+
file
.
path
;
if
(
S_ISDIR
(
file
.
attr
.
st
.
st_mode
))
{
if
(
S_ISDIR
(
file
.
attr
.
st
.
st_mode
))
{
mkdirs
(
path
,
0
);
mkdirs
(
path
.
data
()
,
0
);
}
else
if
(
S_ISREG
(
file
.
attr
.
st
.
st_mode
))
{
}
else
if
(
S_ISREG
(
file
.
attr
.
st
.
st_mode
))
{
if
(
auto
fp
=
xopen_file
(
path
.
data
(),
"we"
))
if
(
auto
fp
=
xopen_file
(
path
.
data
(),
"we"
))
fwrite
(
file
.
content
.
data
(),
1
,
file
.
content
.
size
(),
fp
.
get
());
fwrite
(
file
.
content
.
data
(),
1
,
file
.
content
.
size
(),
fp
.
get
());
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment