From e8e5e6ee3c2a24ba262e85381bc60359a5ce1964 Mon Sep 17 00:00:00 2001 From: Zdenek Kabelac Date: Sat, 14 Oct 2023 16:54:54 +0200 Subject: [PATCH] cov: check next_get token exists --- libdm/libdm-stats.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libdm/libdm-stats.c b/libdm/libdm-stats.c index b8ce4a659..1e71bc0fc 100644 --- a/libdm/libdm-stats.c +++ b/libdm/libdm-stats.c @@ -964,8 +964,8 @@ static int _stats_parse_string_data(char *string_data, char **program_id, if (strstr(p, DMS_GROUP_TAG)) { *aux_data = p; /* Skip over the group tag */ - next_gap = strchr(p, DMS_AUX_SEP_CHAR); - next_gap = strchr(next_gap, ' '); + if ((next_gap = strchr(p, DMS_AUX_SEP_CHAR))) + next_gap = strchr(next_gap, ' '); if (next_gap) { *(next_gap++) = '\0'; *stats_args = next_gap++;