summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorI-Hsien <[email protected]>2023-04-14 08:03:54 +0800
committerGitHub <[email protected]>2023-04-13 20:03:54 -0400
commita08e930e20e7903bd01158315ac627f08910e947 (patch)
tree91cc7f9b4a1c1d77a8eba1b59eaad607de374c19
parentdfe0c6b090f168271123690d545428e3876182aa (diff)
[HUST CSE] Fix nullptr issue in bsp/rv32m1_vega/ri5cy/board/fsl_host.c (#7236)
During the process of statically checking the source code, it was found that this judgment directly obtained the member of the structure pointer without performing a null pointer check. When an upstream function has an exception and passes in a null pointer, a runtime error will occur.
-rw-r--r--bsp/rv32m1_vega/ri5cy/board/fsl_host.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/bsp/rv32m1_vega/ri5cy/board/fsl_host.c b/bsp/rv32m1_vega/ri5cy/board/fsl_host.c
index 8d64cf2ab5..f9a1f786a8 100644
--- a/bsp/rv32m1_vega/ri5cy/board/fsl_host.c
+++ b/bsp/rv32m1_vega/ri5cy/board/fsl_host.c
@@ -51,7 +51,7 @@ static status_t USDHC_TransferFunction(USDHC_Type *base, usdhc_transfer_t *conte
usdhc_adma_config_t dmaConfig;
- if (content->data != NULL)
+ if (content != NULL && content->data != NULL)
{
memset(&dmaConfig, 0, sizeof(usdhc_adma_config_t));
/* config adma */