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

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