Found by coverity.

Signed-off-by: Hannes Reinecke <[email protected]>
---
 libmultipath/alias.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/libmultipath/alias.c b/libmultipath/alias.c
index 5fdcdb5..b86843a 100644
--- a/libmultipath/alias.c
+++ b/libmultipath/alias.c
@@ -229,7 +229,8 @@ allocate_binding(int fd, char *wwid, int id, char *prefix)
                return NULL;
        }
        c = strchr(buf, ' ');
-       *c = '\0';
+       if (c)
+               *c = '\0';
        alias = strdup(buf);
        if (alias == NULL)
                condlog(0, "cannot copy new alias from bindings file : %s",
-- 
2.6.6

--
dm-devel mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/dm-devel

Reply via email to