You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

23 lines
815 B

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