[PATCH v2 09/10] libmultipath: alloc_strvec: NULL-initialize strvec elements

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

 



From: Martin Wilck <mwilck@xxxxxxxx>

The statement assigning a real token to a strvec element may
never be reached. Thus set the element to NULL beforehand to
make sure later code can recognized the non-properly initialized
element.

Signed-off-by: Martin Wilck <mwilck@xxxxxxxx>
---
 libmultipath/parser.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/libmultipath/parser.c b/libmultipath/parser.c
index 3875174..e6753c4 100644
--- a/libmultipath/parser.c
+++ b/libmultipath/parser.c
@@ -237,6 +237,7 @@ alloc_strvec(char *string)
 		if (!vector_alloc_slot(strvec))
 			goto out;
 
+		vector_set_slot(strvec, NULL);
 		start = cp;
 		if (*cp == '"' && !(in_string && *(cp + 1) == '"')) {
 			cp++;
-- 
2.28.0


--
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