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

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