Fixes an issue with running DU sim locally 05/10905/1
authorAbhijit Gadgil <gabhijit@iitbombay.org>
Wed, 12 Apr 2023 12:05:13 +0000 (17:35 +0530)
committerAbhijit Gadgil <gabhijit@iitbombay.org>
Wed, 12 Apr 2023 12:11:55 +0000 (17:41 +0530)
commit7ff0c8ce9187702caa356c0c1f30064c65c1f512
treeead30195f56d4daed73fd47db7820ffd843ee85b
parentaa35a8ecece6592d35971150ee909f7044396bbe
Fixes an issue with running DU sim locally

When DU simulator is run locally, the function crashes due to segfault
inside `nf_oran_du_init` when trying to read `ves_template.json` file.
This is because `ves_template.json` file is not copied during the image
creation.

Also, the actual utility function `file_read_content` instead of
returning a `NULL` crashes, because uninitialized `length` was used to
assign a value when `buffer` was `NULL`. Fixed this as well, the
`buffer[length]` value is only sent if the file exists and a valid
buffer is allocated.

Issue-Id: SIM-109
Change-Id: I75eb985f479331850de2e9fc4aac2ca588fa133c
Signed-off-by: Abhijit Gadgil <gabhijit@iitbombay.org>
ntsimulator/deploy/o-ran-du/local.Dockerfile
ntsimulator/ntsim-ng/utils/sys_utils.c