[PATCH 16/35] libmultipath: fix gcc -Wstringop-overflow warning

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Martin Wilck <mwilck@xxxxxxxx>

This fixes this gcc error message:

error: ‘strncat’ specified bound 1 equals source length
   [-Werror=stringop-overflow=]
Signed-off-by: Martin Wilck <mwilck@xxxxxxxx>
---
 libmultipath/parser.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libmultipath/parser.c b/libmultipath/parser.c
index 11a6168..4f65ba1 100644
--- a/libmultipath/parser.c
+++ b/libmultipath/parser.c
@@ -374,7 +374,7 @@ set_value(vector strvec)
 			goto oom;
 		}
 		if (*alloc != '\0')
-			strncat(alloc, " ", 1);
+			strncat(alloc, " ", len - strlen(alloc));
 		strncat(alloc, str, len - strlen(alloc) - 1);
 	}
 	return alloc;
-- 
2.26.2


--
dm-devel mailing list
dm-devel@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/dm-devel




[Index of Archives]     [DM Crypt]     [Fedora Desktop]     [ATA RAID]     [Fedora Marketing]     [Fedora Packaging]     [Fedora SELinux]     [Yosemite Discussion]     [KDE Users]     [Fedora Docs]

  Powered by Linux