summaryrefslogtreecommitdiff
path: root/daemons
diff options
context:
space:
mode:
authorZdenek Kabelac <zkabelac@redhat.com>2021-09-21 18:24:30 +0200
committerZdenek Kabelac <zkabelac@redhat.com>2021-09-21 21:03:47 +0200
commit7bd55f8c152041101a27c83a96b794fdbb366460 (patch)
tree1d79d5d8a247160306f71506085581cf57f83706 /daemons
parent377e326156c74ef7aa7f5ac286bdabe3143a0b49 (diff)
downloadlvm2-7bd55f8c152041101a27c83a96b794fdbb366460.tar.gz
cov: check strchr for NULL
Although unlikely, ensuring coverity we not use NULL.
Diffstat (limited to 'daemons')
-rw-r--r--daemons/lvmlockd/lvmlockd-dlm.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/daemons/lvmlockd/lvmlockd-dlm.c b/daemons/lvmlockd/lvmlockd-dlm.c
index 68d18607c..1305c3dc2 100644
--- a/daemons/lvmlockd/lvmlockd-dlm.c
+++ b/daemons/lvmlockd/lvmlockd-dlm.c
@@ -801,7 +801,8 @@ int lm_refresh_lv_start_dlm(struct action *act)
strncpy(path, act->path, PATH_MAX-1);
/* skip past dev */
- p = strchr(path + 1, '/');
+ if (!(p = strchr(path + 1, '/')))
+ return -EINVAL;
/* skip past slashes */
while (*p == '/')