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