summaryrefslogtreecommitdiff
path: root/src/daemon/dlt_daemon_common.c
diff options
context:
space:
mode:
authorBui Nguyen Quoc Thanh <thanh.buinguyenquoc@vn.bosch.com>2021-05-10 14:02:41 +0700
committerBui Nguyen Quoc Thanh <thanh.buinguyenquoc@vn.bosch.com>2021-05-10 14:02:41 +0700
commitad8a6ab070803f2b0e0fa177fd6638c10db2dde3 (patch)
treec193ae5c2b919f89415a815b78ab54a7661a2619 /src/daemon/dlt_daemon_common.c
parentb95044abb202838837b0566efc40ae26308a4bb4 (diff)
downloadDLT-daemon-ad8a6ab070803f2b0e0fa177fd6638c10db2dde3.tar.gz
daemon: check the conf inputs
The configuration of memory buffer size must be carefully parsed and validated to avoid segmentation fault Any misleading information in configuration file must be considered as major error and dlt-daemon should stop and raise error message to stderr This commit also corrects error handling of dlt_buffer_init_dynamic(). Signed-off-by: Bui Nguyen Quoc Thanh <thanh.buinguyenquoc@vn.bosch.com>
Diffstat (limited to 'src/daemon/dlt_daemon_common.c')
-rw-r--r--src/daemon/dlt_daemon_common.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/daemon/dlt_daemon_common.c b/src/daemon/dlt_daemon_common.c
index 5273433..e56b751 100644
--- a/src/daemon/dlt_daemon_common.c
+++ b/src/daemon/dlt_daemon_common.c
@@ -236,8 +236,10 @@ int dlt_daemon_init(DltDaemon *daemon,
dlt_vlog(LOG_INFO, "Ringbuffer configuration: %lu/%lu/%lu\n",
RingbufferMinSize, RingbufferMaxSize, RingbufferStepSize);
- if (dlt_buffer_init_dynamic(&(daemon->client_ringbuffer), (uint32_t) RingbufferMinSize, (uint32_t) RingbufferMaxSize,
- (uint32_t) RingbufferStepSize) == DLT_RETURN_ERROR)
+ if (dlt_buffer_init_dynamic(&(daemon->client_ringbuffer),
+ (uint32_t) RingbufferMinSize,
+ (uint32_t) RingbufferMaxSize,
+ (uint32_t) RingbufferStepSize) < DLT_RETURN_OK)
return -1;
daemon->storage_handle = NULL;