From c4d56a9331284c166d711ed15e46a80f556ed491 Mon Sep 17 00:00:00 2001 From: Dong Anyuan <donganyuan@cn.fujitsu.com> Date: Thu, 20 Jun 2019 12:02:32 +0900 Subject: [PATCH] Fix Coverity Scan CID 60471 (Function memory_read does not terminate string *user->nas_user_nvdata.) --- openair3/NAS/UE/nas_user.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/openair3/NAS/UE/nas_user.c b/openair3/NAS/UE/nas_user.c index d3467eddd5..51f72a2ad9 100644 --- a/openair3/NAS/UE/nas_user.c +++ b/openair3/NAS/UE/nas_user.c @@ -161,6 +161,8 @@ void nas_user_initialize(nas_user_t *user, emm_indication_callback_t emm_cb, user->nas_user_nvdata = calloc_or_fail(sizeof(user_nvdata_t)); + memset(user->nas_user_nvdata, 0, sizeof(user_nvdata_t)); + /* Get UE data stored in the non-volatile memory device */ int rc = memory_read(user->user_nvdata_store, user->nas_user_nvdata, sizeof(user_nvdata_t)); if (rc != RETURNok) { -- GitLab