Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
libdap-server-core
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
Container 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
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
cellframe
libdap-server-core
Commits
51504247
Commit
51504247
authored
6 years ago
by
Anatolii Kurotych
Browse files
Options
Downloads
Patches
Plain Diff
[+] warning buf overflow in dap_client_remote_write
parent
a655fc56
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
dap_client_remote.c
+6
-3
6 additions, 3 deletions
dap_client_remote.c
with
6 additions
and
3 deletions
dap_client_remote.c
+
6
−
3
View file @
51504247
...
@@ -184,10 +184,13 @@ void dap_client_remote_ready_to_write(dap_client_remote_t * sc,bool is_ready)
...
@@ -184,10 +184,13 @@ void dap_client_remote_ready_to_write(dap_client_remote_t * sc,bool is_ready)
* @return Number of bytes that were placed into the buffer
* @return Number of bytes that were placed into the buffer
*/
*/
size_t
dap_client_remote_write
(
dap_client_remote_t
*
sc
,
const
void
*
data
,
size_t
data_size
)
size_t
dap_client_remote_write
(
dap_client_remote_t
*
sc
,
const
void
*
data
,
size_t
data_size
)
{
{
data_size
=
((
sc
->
buf_out_size
+
data_size
)
<
(
sizeof
(
sc
->
buf_out
)))
?
data_size
:
(
sizeof
(
sc
->
buf_out
)
-
sc
->
buf_out_size
);
if
(
sc
->
buf_out_size
+
data_size
>
sizeof
(
sc
->
buf_out
)
)
{
log_it
(
L_WARNING
,
"Client buffer overflow. Packet loosed"
);
return
0
;
}
memcpy
(
sc
->
buf_out
+
sc
->
buf_out_size
,
data
,
data_size
);
memcpy
(
sc
->
buf_out
+
sc
->
buf_out_size
,
data
,
data_size
);
sc
->
buf_out_size
+=
data_size
;
sc
->
buf_out_size
+=
data_size
;
return
data_size
;
return
data_size
;
}
}
...
...
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