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
1fe2a353
Commit
1fe2a353
authored
Apr 08, 2008
by
Wayne Davison
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed a potential overflow issue with realloc() that Sebastian Krahmer
pointed out.
parent
237e9a17
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
2 deletions
+5
-2
util.c
util.c
+5
-2
No files found.
util.c
View file @
1fe2a353
...
...
@@ -1329,7 +1329,7 @@ void *_new_array(unsigned long num, unsigned int size, int use_calloc)
return
use_calloc
?
calloc
(
num
,
size
)
:
malloc
(
num
*
size
);
}
void
*
_realloc_array
(
void
*
ptr
,
unsigned
int
size
,
unsigned
long
num
)
void
*
_realloc_array
(
void
*
ptr
,
unsigned
int
size
,
size_t
num
)
{
if
(
num
>=
MALLOC_MAX
/
size
)
return
NULL
;
...
...
@@ -1550,7 +1550,10 @@ void *expand_item_list(item_list *lp, size_t item_size,
new_size
+=
incr
;
else
new_size
*=
2
;
new_ptr
=
realloc_array
(
lp
->
items
,
char
,
new_size
*
item_size
);
if
(
new_size
<
lp
->
malloced
)
overflow_exit
(
"expand_item_list"
);
/* Using _realloc_array() lets us pass the size, not a type. */
new_ptr
=
_realloc_array
(
lp
->
items
,
item_size
,
new_size
);
if
(
verbose
>=
4
)
{
rprintf
(
FINFO
,
"[%s] expand %s to %.0f bytes, did%s move
\n
"
,
who_am_i
(),
desc
,
(
double
)
new_size
*
item_size
,
...
...
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