Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
B
babeld
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
babeld
Commits
f13c34a1
Commit
f13c34a1
authored
Mar 26, 2008
by
Juliusz Chroboczek
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Avoid crash when resizing receive buffer.
parent
70bc5fe5
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
10 deletions
+12
-10
babel.c
babel.c
+12
-10
No files found.
babel.c
View file @
f13c34a1
...
@@ -815,24 +815,26 @@ schedule_neighbours_check(int msecs, int override)
...
@@ -815,24 +815,26 @@ schedule_neighbours_check(int msecs, int override)
void
void
resize_receive_buffer
(
int
size
)
resize_receive_buffer
(
int
size
)
{
{
char
*
new
;
if
(
size
<=
receive_buffer_size
)
if
(
size
<=
receive_buffer_size
)
return
;
return
;
if
(
receive_buffer
==
NULL
)
{
if
(
receive_buffer
==
NULL
)
{
receive_buffer
=
malloc
(
size
);
receive_buffer
=
malloc
(
size
);
if
(
receive_buffer
==
NULL
)
if
(
receive_buffer
==
NULL
)
{
perror
(
"malloc(receive_buffer)"
);
return
;
return
;
}
receive_buffer_size
=
size
;
}
else
{
unsigned
char
*
new
;
new
=
realloc
(
receive_buffer
,
size
);
if
(
new
==
NULL
)
{
perror
(
"realloc(receive_buffer)"
);
return
;
}
new
=
receive_buffer
;
receive_buffer_size
=
size
;
receive_buffer_size
=
size
;
}
}
new
=
realloc
(
receive_buffer
,
size
);
if
(
new
==
NULL
)
{
perror
(
"malloc(receive_buffer)"
);
return
;
}
receive_buffer_size
=
size
;
}
}
static
void
static
void
...
...
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