2 libmultipath/print.c | 31 +++++++++++++++++++++++++++----
3 1 file changed, 27 insertions(+), 4 deletions(-)
5 Index: multipath-tools-130222/libmultipath/print.c
6 ===================================================================
7 --- multipath-tools-130222.orig/libmultipath/print.c
8 +++ multipath-tools-130222/libmultipath/print.c
19 #include "switchgroup.h"
20 #include "devmapper.h"
24 #define MAX(x,y) (x > y) ? x : y
25 #define TAIL (line + len - 1 - c)
26 @@ -754,12 +757,32 @@ snprint_pathgroup (char * line, int len,
28 print_multipath_topology (struct multipath * mpp, int verbosity)
30 - char buff[MAX_LINE_LEN * MAX_LINES] = {};
34 + int len, maxlen = MAX_LINE_LEN * MAX_LINES;
36 - memset(&buff[0], 0, MAX_LINE_LEN * MAX_LINES);
37 - snprint_multipath_topology(&buff[0], MAX_LINE_LEN * MAX_LINES,
39 + buff = MALLOC(maxlen);
44 + condlog(0, "couldn't allocate memory for list: %s\n",
49 + len = snprint_multipath_topology(buff, maxlen, mpp, verbosity);
50 + resize = (len == maxlen - 1);
55 + buff = REALLOC(buff, maxlen);