Blame SOURCES/0222-RHBZ-1457288-fix-show-maps-json.patch

45d01a
---
45d01a
 multipathd/cli_handlers.c |    6 ++++--
45d01a
 1 file changed, 4 insertions(+), 2 deletions(-)
45d01a
45d01a
Index: multipath-tools-130222/multipathd/cli_handlers.c
45d01a
===================================================================
45d01a
--- multipath-tools-130222.orig/multipathd/cli_handlers.c
45d01a
+++ multipath-tools-130222/multipathd/cli_handlers.c
45d01a
@@ -133,10 +133,12 @@ show_maps_json (char ** r, int * len, st
45d01a
 	struct multipath * mpp;
45d01a
 	char * c;
45d01a
 	char * reply;
45d01a
-	unsigned int maxlen = INITIAL_REPLY_LEN *
45d01a
-			PRINT_JSON_MULTIPLIER * VECTOR_SIZE(vecs->mpvec);
45d01a
+	unsigned int maxlen = INITIAL_REPLY_LEN;
45d01a
 	int again = 1;
45d01a
 
45d01a
+	if (VECTOR_SIZE(vecs->mpvec) > 0)
45d01a
+		maxlen *= PRINT_JSON_MULTIPLIER * VECTOR_SIZE(vecs->mpvec);
45d01a
+
45d01a
 	vector_foreach_slot(vecs->mpvec, mpp, i) {
45d01a
 		if (update_multipath(vecs, mpp->alias, 0)) {
45d01a
 			return 1;