Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
adam.huang
Arm Trusted Firmware
Commits
44de593d
Commit
44de593d
authored
Apr 30, 2021
by
Manish Pandey
Committed by
TrustedFirmware Code Review
Apr 30, 2021
Browse files
Merge "plat/st: do not rely on tainted value for dt property length" into integration
parents
711505f0
f714ca80
Changes
1
Hide whitespace changes
Inline
Side-by-side
plat/st/common/stm32mp_dt.c
View file @
44de593d
/*
* Copyright (c) 2017-202
0
, ARM Limited and Contributors. All rights reserved.
* Copyright (c) 2017-202
1
, ARM Limited and Contributors. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
...
...
@@ -72,21 +72,20 @@ bool fdt_check_node(int node)
uint8_t
fdt_get_status
(
int
node
)
{
uint8_t
status
=
DT_DISABLED
;
int
len
;
const
char
*
cchar
;
cchar
=
fdt_getprop
(
fdt
,
node
,
"status"
,
&
len
);
cchar
=
fdt_getprop
(
fdt
,
node
,
"status"
,
NULL
);
if
((
cchar
==
NULL
)
||
(
strncmp
(
cchar
,
"okay"
,
(
size_t
)
len
)
==
0
))
{
(
strncmp
(
cchar
,
"okay"
,
strlen
(
"okay"
)
)
==
0
))
{
status
|=
DT_NON_SECURE
;
}
cchar
=
fdt_getprop
(
fdt
,
node
,
"secure-status"
,
&
len
);
cchar
=
fdt_getprop
(
fdt
,
node
,
"secure-status"
,
NULL
);
if
(
cchar
==
NULL
)
{
if
(
status
==
DT_NON_SECURE
)
{
status
|=
DT_SECURE
;
}
}
else
if
(
strncmp
(
cchar
,
"okay"
,
(
size_t
)
len
)
==
0
)
{
}
else
if
(
strncmp
(
cchar
,
"okay"
,
strlen
(
"okay"
)
)
==
0
)
{
status
|=
DT_SECURE
;
}
...
...
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