Discovered by Coverity (CID 173257).
Signed-off-by: Bart Van Assche <[email protected]>
---
libmultipath/discovery.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/libmultipath/discovery.c b/libmultipath/discovery.c
index 4b31ddef23f0..fe50ce5062ea 100644
--- a/libmultipath/discovery.c
+++ b/libmultipath/discovery.c
@@ -52,8 +52,8 @@ alloc_path_with_pathinfo (struct config *conf, struct
udev_device *udevice,
if (!pp)
return PATHINFO_FAILED;
- if(wwid)
- strncpy(pp->wwid, wwid, sizeof(pp->wwid));
+ if (wwid)
+ strlcpy(pp->wwid, wwid, sizeof(pp->wwid));
if (safe_sprintf(pp->dev, "%s", devname)) {
condlog(0, "pp->dev too small");
--
2.16.2
--
dm-devel mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/dm-devel