diff options
author | Manish Pandey <manish.pandey2@arm.com> | 2021-04-30 13:04:23 +0200 |
---|---|---|
committer | TrustedFirmware Code Review <review@review.trustedfirmware.org> | 2021-04-30 13:04:23 +0200 |
commit | 44de593d196dc5a81adfd44c9983c00da08520a9 (patch) | |
tree | 1eb0085268e005ab8a475dbcbf988e95774d572c | |
parent | 711505f045cb02092ffb756000871a185e9b7b0b (diff) | |
parent | f714ca80b8e3dc4e953b8728fc7b9457094b2a12 (diff) | |
download | trusted-firmware-a-44de593d196dc5a81adfd44c9983c00da08520a9.tar.gz |
Merge "plat/st: do not rely on tainted value for dt property length" into integration
-rw-r--r-- | plat/st/common/stm32mp_dt.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/plat/st/common/stm32mp_dt.c b/plat/st/common/stm32mp_dt.c index 391e5f0547..4f130ce20c 100644 --- a/plat/st/common/stm32mp_dt.c +++ b/plat/st/common/stm32mp_dt.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017-2020, ARM Limited and Contributors. All rights reserved. + * Copyright (c) 2017-2021, 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; } |