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
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
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
lizhongxiao
OpenXG-RAN
Commits
d1740c9d
Commit
d1740c9d
authored
Oct 23, 2023
by
Robert Schmidt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Deep-copy PDSCH_ConfigCommon to prevent double-free
parent
8062af94
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
1 deletion
+18
-1
openair2/RRC/NR/nr_rrc_config.c
openair2/RRC/NR/nr_rrc_config.c
+18
-1
No files found.
openair2/RRC/NR/nr_rrc_config.c
View file @
d1740c9d
...
...
@@ -103,6 +103,23 @@ static NR_SetupRelease_PUCCH_ConfigCommon_t *clone_pucch_configcommon(const NR_S
return
clone
;
}
static
NR_SetupRelease_PDSCH_ConfigCommon_t
*
clone_pdsch_configcommon
(
const
NR_SetupRelease_PDSCH_ConfigCommon_t
*
pcc
)
{
if
(
pcc
==
NULL
||
pcc
->
present
==
NR_SetupRelease_PDSCH_ConfigCommon_PR_NOTHING
)
return
NULL
;
NR_SetupRelease_PDSCH_ConfigCommon_t
*
clone
=
calloc_or_fail
(
1
,
sizeof
(
*
clone
));
clone
->
present
=
pcc
->
present
;
if
(
clone
->
present
==
NR_SetupRelease_PDSCH_ConfigCommon_PR_release
)
return
clone
;
uint8_t
buf
[
1024
];
asn_enc_rval_t
enc_rval
=
uper_encode_to_buffer
(
&
asn_DEF_NR_PDSCH_ConfigCommon
,
NULL
,
pcc
->
choice
.
setup
,
buf
,
sizeof
(
buf
));
AssertFatal
(
enc_rval
.
encoded
>
0
&&
enc_rval
.
encoded
<
sizeof
(
buf
),
"could not clone NR_PDSCH_ConfigCommon: problem while encoding
\n
"
);
asn_dec_rval_t
dec_rval
=
uper_decode
(
NULL
,
&
asn_DEF_NR_PDSCH_ConfigCommon
,
(
void
**
)
&
clone
->
choice
.
setup
,
buf
,
enc_rval
.
encoded
,
0
,
0
);
AssertFatal
(
dec_rval
.
code
==
RC_OK
&&
dec_rval
.
consumed
==
enc_rval
.
encoded
,
"could not clone NR_PDSCH_ConfigCommon: problem while decoding
\n
"
);
return
clone
;
}
static
NR_SearchSpace_t
*
rrc_searchspace_config
(
bool
is_common
,
int
searchspaceid
,
int
coresetid
)
{
...
...
@@ -1918,7 +1935,7 @@ NR_BCCH_DL_SCH_Message_t *get_SIB1_NR(const NR_ServingCellConfigCommon_t *scc, c
asn1cCallocOne
(
initialDownlinkBWP
->
pdcch_ConfigCommon
->
choice
.
setup
->
pagingSearchSpace
,
2
);
asn1cCallocOne
(
initialDownlinkBWP
->
pdcch_ConfigCommon
->
choice
.
setup
->
ra_SearchSpace
,
1
);
initialDownlinkBWP
->
pdsch_ConfigCommon
=
scc
->
downlinkConfigCommon
->
initialDownlinkBWP
->
pdsch_ConfigCommon
;
initialDownlinkBWP
->
pdsch_ConfigCommon
=
clone_pdsch_configcommon
(
scc
->
downlinkConfigCommon
->
initialDownlinkBWP
->
pdsch_ConfigCommon
)
;
ServCellCom
->
downlinkConfigCommon
.
bcch_Config
.
modificationPeriodCoeff
=
NR_BCCH_Config__modificationPeriodCoeff_n2
;
ServCellCom
->
downlinkConfigCommon
.
pcch_Config
.
defaultPagingCycle
=
NR_PagingCycle_rf256
;
ServCellCom
->
downlinkConfigCommon
.
pcch_Config
.
nAndPagingFrameOffset
.
present
=
NR_PCCH_Config__nAndPagingFrameOffset_PR_quarterT
;
...
...
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