diff options
author | Alexander Mohr <alexander.m.mohr@mercedes-benz.com> | 2022-09-28 10:22:19 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-09-28 10:22:19 +0200 |
commit | a6c42a0c5c67e764d964f91234b9c8c0f9d09b54 (patch) | |
tree | 3be72561824a86f7ebb97098aec861db4cba3bcc /src/gateway/dlt_gateway.c | |
parent | 26dd01c3eff30ad00300b8a47f13c29d1ba31019 (diff) | |
download | DLT-daemon-a6c42a0c5c67e764d964f91234b9c8c0f9d09b54.tar.gz |
dlt-gateway: Fix crash on invalid ip (#381)
* dlt-gateway crashed when an invalid
ip address was configured as a null pointer
was used for strdup
Signed-off-by: Alexander Mohr <alexander.m.mohr@mercedes-benz.com>
Diffstat (limited to 'src/gateway/dlt_gateway.c')
-rw-r--r-- | src/gateway/dlt_gateway.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/gateway/dlt_gateway.c b/src/gateway/dlt_gateway.c index 9d0041d..ae93c1b 100644 --- a/src/gateway/dlt_gateway.c +++ b/src/gateway/dlt_gateway.c @@ -791,6 +791,10 @@ int dlt_gateway_configure(DltGateway *gateway, char *config_file, int verbose) configuration_entries[j].key, value); } + if (!tmp.ip_address) { + invalid = 1; + } + if (invalid) { dlt_vlog(LOG_ERR, "%s configuration is invalid.\n" |