Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
map-controller
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Issue analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Multi-AP
map-controller
Commits
8944352f
Commit
8944352f
authored
2 years ago
by
Kamil Zulewski
Browse files
Options
Downloads
Patches
Plain Diff
Add sanity buffer size check to cntlr_gen_agent_list_tlv
parent
931ddfed
Branches
Branches containing commit
No related tags found
1 merge request
!183
Add sanity buffer size check to cntlr_gen_agent_list_tlv
Pipeline
#78435
passed
2 years ago
Stage: static_code_analysis
Stage: compile_test
Changes
1
Pipelines
3
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/cntlr_tlv.c
+5
-1
5 additions, 1 deletion
src/cntlr_tlv.c
with
5 additions
and
1 deletion
src/cntlr_tlv.c
+
5
−
1
View file @
8944352f
...
@@ -1716,9 +1716,10 @@ int cntlr_gen_agent_list_tlv(struct controller *c, struct cmdu_buff *frm)
...
@@ -1716,9 +1716,10 @@ int cntlr_gen_agent_list_tlv(struct controller *c, struct cmdu_buff *frm)
struct
tlv_agent_list
*
tlv_data
;
struct
tlv_agent_list
*
tlv_data
;
struct
node
*
n
;
struct
node
*
n
;
int
i
;
int
i
;
const
uint16_t
max_tlv_len
=
512
;
dbg
(
"%s: --->
\n
"
,
__func__
);
dbg
(
"%s: --->
\n
"
,
__func__
);
t
=
cmdu_reserve_tlv
(
frm
,
512
);
t
=
cmdu_reserve_tlv
(
frm
,
max_tlv_len
);
if
(
!
t
)
if
(
!
t
)
return
-
1
;
return
-
1
;
...
@@ -1732,6 +1733,9 @@ int cntlr_gen_agent_list_tlv(struct controller *c, struct cmdu_buff *frm)
...
@@ -1732,6 +1733,9 @@ int cntlr_gen_agent_list_tlv(struct controller *c, struct cmdu_buff *frm)
t
->
len
=
sizeof
(
tlv_data
->
num_agent
)
+
t
->
len
=
sizeof
(
tlv_data
->
num_agent
)
+
tlv_data
->
num_agent
*
sizeof
(
tlv_data
->
agent
[
0
]);
tlv_data
->
num_agent
*
sizeof
(
tlv_data
->
agent
[
0
]);
if
(
t
->
len
>
max_tlv_len
)
return
-
1
;
i
=
0
;
i
=
0
;
list_for_each_entry
(
n
,
&
c
->
nodelist
,
list
)
{
list_for_each_entry
(
n
,
&
c
->
nodelist
,
list
)
{
dbg
(
"
\t
agent[%d]:
\n
"
,
i
);
dbg
(
"
\t
agent[%d]:
\n
"
,
i
);
...
...
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