diff options
author | Saya Sugiura <ssugiura@jp.adit-jv.com> | 2020-02-18 19:45:59 +0900 |
---|---|---|
committer | Saya Sugiura <39760799+ssugiura@users.noreply.github.com> | 2020-07-06 10:04:07 +0900 |
commit | 4d762be98089a4781a937fcbd423f09f939a153a (patch) | |
tree | 3ad30f6e8551e00bf3ac858223a2904a89df11d6 /src/offlinelogstorage | |
parent | 0ae98e7b46f13d415e051a7acdfd7d703c5c25f9 (diff) | |
download | DLT-daemon-4d762be98089a4781a937fcbd423f09f939a153a.tar.gz |
logstorage: Add NULL check of IDs
There is a missing NULL check for APID and CTID in
dlt_logstorage_create_keys() function in following condition:
- APID is wildcard
- CTID is wildcard
- ECUID is set
Related commit:
557624f SOPL-8567: daemon: logstorage with wildcards
Signed-off-by: Saya Sugiura <ssugiura@jp.adit-jv.com>
Diffstat (limited to 'src/offlinelogstorage')
-rw-r--r-- | src/offlinelogstorage/dlt_offline_logstorage.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/offlinelogstorage/dlt_offline_logstorage.c b/src/offlinelogstorage/dlt_offline_logstorage.c index 948fbee..7bc7bfd 100644 --- a/src/offlinelogstorage/dlt_offline_logstorage.c +++ b/src/offlinelogstorage/dlt_offline_logstorage.c @@ -639,7 +639,8 @@ DLT_STATIC int dlt_logstorage_create_keys(char *apids, /* Handle ecuid alone case here */ if (((apids == NULL) && (ctids == NULL) && (ecuid != NULL)) || - ((strncmp(apids, ".*", 2) == 0) && (strncmp(ctids, ".*", 2) == 0) && (ecuid != NULL)) ) { + ((apids != NULL) && (strncmp(apids, ".*", 2) == 0) && + (ctids != NULL) && (strncmp(ctids, ".*", 2) == 0) && (ecuid != NULL)) ) { dlt_logstorage_create_keys_only_ecu(ecuid, curr_key); *(num_keys) = 1; *(keys) = (char *)calloc(*num_keys * DLT_OFFLINE_LOGSTORAGE_MAX_KEY_LEN, |