From 0ff6c45532fb4e289ceac882c69537efa3a6d53c Mon Sep 17 00:00:00 2001 From: Hannes Reinecke Date: Fri, 14 Nov 2008 10:02:56 +0100 Subject: [PATCH] libmultipath: zero out lines in print.c static declaration of line within a function doesn't place them in the bss segment, hence they are not zeroed automatically. Gives funny effects occasionally. Signed-off-by: Hannes Reinecke --- libmultipath/print.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/libmultipath/print.c b/libmultipath/print.c index a2253be..986263f 100644 --- a/libmultipath/print.c +++ b/libmultipath/print.c @@ -1303,6 +1303,7 @@ print_path (struct path * pp, char * style) { char line[MAX_LINE_LEN]; + memset(&line[0], 0, MAX_LINE_LEN); snprint_path(&line[0], MAX_LINE_LEN, style, pp); printf("%s", line); } @@ -1312,6 +1313,7 @@ print_multipath (struct multipath * mpp, char * style) { char line[MAX_LINE_LEN]; + memset(&line[0], 0, MAX_LINE_LEN); snprint_multipath(&line[0], MAX_LINE_LEN, style, mpp); printf("%s", line); } @@ -1321,6 +1323,7 @@ print_pathgroup (struct pathgroup * pgp, char * style) { char line[MAX_LINE_LEN]; + memset(&line[0], 0, MAX_LINE_LEN); snprint_pathgroup(&line[0], MAX_LINE_LEN, style, pgp); printf("%s", line); } -- 2.7.4