Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
OpenXG-RAN
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
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
OpenXG
OpenXG-RAN
Commits
76f06a93
Commit
76f06a93
authored
May 31, 2024
by
Robert Schmidt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Correctly compute array size to prevent buffer overflow
Reviewed-By:
Laurent THOMAS
<
laurent.thomas@open-cells.com
>
parent
e5fc1ebd
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c
openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c
+2
-2
No files found.
openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c
View file @
76f06a93
...
...
@@ -130,7 +130,7 @@ static int estimate_ul_buffer_short_bsr(const NR_BSR_SHORT *bsr)
* differentiate them */
int
rep_idx
=
bsr
->
Buffer_size
;
int
estim_idx
=
overestim_bsr_index
(
rep_idx
);
int
max
=
sizeofArray
(
NR_SHORT_BSR_TABLE
);
int
max
=
sizeofArray
(
NR_SHORT_BSR_TABLE
)
-
1
;
int
idx
=
min
(
estim_idx
,
max
);
int
estim_size
=
NR_SHORT_BSR_TABLE
[
idx
];
LOG_D
(
NR_MAC
,
"short BSR LCGID %d index %d estim index %d size %d
\n
"
,
bsr
->
LcgID
,
rep_idx
,
estim_idx
,
estim_size
);
...
...
@@ -152,7 +152,7 @@ static int estimate_ul_buffer_long_bsr(const NR_BSR_LONG *bsr)
bool
bsr_active
[
8
]
=
{
bsr
->
LcgID0
!=
0
,
bsr
->
LcgID1
!=
0
,
bsr
->
LcgID2
!=
0
,
bsr
->
LcgID3
!=
0
,
bsr
->
LcgID4
!=
0
,
bsr
->
LcgID5
!=
0
,
bsr
->
LcgID6
!=
0
,
bsr
->
LcgID7
!=
0
};
int
estim_size
=
0
;
int
max
=
sizeofArray
(
NR_LONG_BSR_TABLE
);
int
max
=
sizeofArray
(
NR_LONG_BSR_TABLE
)
-
1
;
uint8_t
*
payload
=
((
uint8_t
*
)
bsr
)
+
1
;
int
m
=
0
;
const
int
total_lcgids
=
8
;
/* see 38.321 6.1.3.1 */
...
...
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