Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
openairinterface5G
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor 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
Show more breadcrumbs
Bin He
openairinterface5G
Commits
456e6c92
Commit
456e6c92
authored
4 years ago
by
Panos Matzakos
Browse files
Options
Downloads
Patches
Plain Diff
Change return type of nr_generate_ulsch_pdu() to avoid overflow on the offset variable
parent
45ed1e80
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
openair2/LAYER2/NR_MAC_UE/mac_proto.h
+1
-1
1 addition, 1 deletion
openair2/LAYER2/NR_MAC_UE/mac_proto.h
openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c
+4
-3
4 additions, 3 deletions
openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c
with
5 additions
and
4 deletions
openair2/LAYER2/NR_MAC_UE/mac_proto.h
+
1
−
1
View file @
456e6c92
...
...
@@ -139,7 +139,7 @@ void nr_ue_process_mac_pdu(module_id_t module_idP,
NR_UL_TIME_ALIGNMENT_t
*
ul_time_alignment
);
u
nsigned
char
nr_generate_ulsch_pdu
(
uint8_t
*
sdus_payload
,
u
int16_t
nr_generate_ulsch_pdu
(
uint8_t
*
sdus_payload
,
uint8_t
*
pdu
,
uint8_t
num_sdus
,
uint16_t
*
sdu_lengths
,
...
...
This diff is collapsed.
Click to expand it.
openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c
+
4
−
3
View file @
456e6c92
...
...
@@ -3723,7 +3723,7 @@ void nr_ue_process_mac_pdu(module_id_t module_idP,
/////* ULSCH MAC PDU generation (6.1.2 TS 38.321) */////
////////////////////////////////////////////////////////
u
nsigned
char
nr_generate_ulsch_pdu
(
uint8_t
*
sdus_payload
,
u
int16_t
nr_generate_ulsch_pdu
(
uint8_t
*
sdus_payload
,
uint8_t
*
pdu
,
uint8_t
num_sdus
,
uint16_t
*
sdu_lengths
,
...
...
@@ -3738,7 +3738,8 @@ unsigned char nr_generate_ulsch_pdu(uint8_t *sdus_payload,
NR_MAC_SUBHEADER_FIXED
*
mac_pdu_ptr
=
(
NR_MAC_SUBHEADER_FIXED
*
)
pdu
;
unsigned
char
last_size
=
0
,
i
,
mac_header_control_elements
[
16
],
*
ce_ptr
,
bsr
=
0
;
int
mac_ce_size
,
offset
;
int
mac_ce_size
;
uint16_t
offset
=
0
;
LOG_D
(
MAC
,
"[UE] Generating ULSCH PDU : num_sdus %d
\n
"
,
num_sdus
);
...
...
@@ -3888,7 +3889,7 @@ unsigned char nr_generate_ulsch_pdu(uint8_t *sdus_payload,
// compute final offset
offset
=
((
unsigned
char
*
)
mac_pdu_ptr
-
pdu
);
//printf("Offset %d \n", ((unsigned char *) mac_pdu_ptr -
mac_
pdu));
//printf("Offset %d \n", ((unsigned char *) mac_pdu_ptr - pdu));
return
offset
;
}
...
...
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