diff options
author | Zdenek Kabelac <zkabelac@redhat.com> | 2021-09-21 18:24:30 +0200 |
---|---|---|
committer | Zdenek Kabelac <zkabelac@redhat.com> | 2021-09-21 21:03:47 +0200 |
commit | 7bd55f8c152041101a27c83a96b794fdbb366460 (patch) | |
tree | 1d79d5d8a247160306f71506085581cf57f83706 /daemons | |
parent | 377e326156c74ef7aa7f5ac286bdabe3143a0b49 (diff) | |
download | lvm2-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.c | 3 |
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 == '/') |