Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
liblongpath-rsync
Project
Project
Details
Activity
Releases
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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
liblongpath
liblongpath-rsync
Commits
774d1c36
Commit
774d1c36
authored
Apr 15, 2008
by
Wayne Davison
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use overflow_exit() for overflows, not out_of_memory().
parent
1b8e0e87
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
7 deletions
+7
-7
xattrs.c
xattrs.c
+7
-7
No files found.
xattrs.c
View file @
774d1c36
...
...
@@ -178,8 +178,9 @@ static char *get_xattr_data(const char *fname, const char *name, size_t *len_ptr
if
(
!
datum_len
&&
!
extra_len
)
extra_len
=
1
;
/* request non-zero amount of memory */
if
(
datum_len
+
extra_len
<
datum_len
/* checks for overflow */
||
!
(
ptr
=
new_array
(
char
,
datum_len
+
extra_len
)))
if
(
datum_len
+
extra_len
<
datum_len
)
overflow_exit
(
"get_xattr_data"
);
if
(
!
(
ptr
=
new_array
(
char
,
datum_len
+
extra_len
)))
out_of_memory
(
"get_xattr_data"
);
if
(
datum_len
)
{
...
...
@@ -557,7 +558,7 @@ int recv_xattr_request(struct file_struct *file, int f_in)
rxa
->
datum_len
=
read_varint
(
f_in
);
if
(
rxa
->
name_len
+
rxa
->
datum_len
<
rxa
->
name_len
)
o
ut_of_memory
(
"recv_xattr_request"
);
/* overflow */
o
verflow_exit
(
"recv_xattr_request"
);
rxa
->
datum
=
new_array
(
char
,
rxa
->
datum_len
+
rxa
->
name_len
);
if
(
!
rxa
->
datum
)
out_of_memory
(
"recv_xattr_request"
);
...
...
@@ -609,10 +610,9 @@ void receive_xattr(struct file_struct *file, int f)
size_t
datum_len
=
read_varint
(
f
);
size_t
dget_len
=
datum_len
>
MAX_FULL_DATUM
?
1
+
MAX_DIGEST_LEN
:
datum_len
;
size_t
extra_len
=
MIGHT_NEED_RPRE
?
RPRE_LEN
:
0
;
if
(
dget_len
+
extra_len
<
dget_len
)
out_of_memory
(
"receive_xattr"
);
/* overflow */
if
(
dget_len
+
extra_len
+
name_len
<
dget_len
)
out_of_memory
(
"receive_xattr"
);
/* overflow */
if
((
dget_len
+
extra_len
<
dget_len
)
||
(
dget_len
+
extra_len
+
name_len
<
dget_len
))
overflow_exit
(
"receive_xattr"
);
ptr
=
new_array
(
char
,
dget_len
+
extra_len
+
name_len
);
if
(
!
ptr
)
out_of_memory
(
"receive_xattr"
);
...
...
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