summaryrefslogtreecommitdiffstats
path: root/0080-RHBZ-662731-fix-no-config-value-segfault.patch
blob: 72189bcb791b31b4e60af08ad3498bbf1ab6e255 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
---
 libmultipath/parser.c |   11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

Index: multipath-tools/libmultipath/parser.c
===================================================================
--- multipath-tools.orig/libmultipath/parser.c
+++ multipath-tools/libmultipath/parser.c
@@ -386,13 +386,20 @@ alloc_value_block(vector strvec, void (*
 void *
 set_value(vector strvec)
 {
-	char *str = VECTOR_SLOT(strvec, 1);
-	int size = strlen(str);
+	char *str;
+	int size;
 	int i = 0;
 	int len = 0;
 	char *alloc = NULL;
 	char *tmp;
 
+	str = VECTOR_SLOT(strvec, 1);
+	if (!str) {
+		str = VECTOR_SLOT(strvec, 0);
+		condlog(0, "option '%s' missing value\n", str);
+		return NULL;
+	}
+	size = strlen(str);
 	if (*str == '"') {
 		for (i = 2; i < VECTOR_SIZE(strvec); i++) {
 			str = VECTOR_SLOT(strvec, i);