Blame SOURCES/0018-Monitor-Increase-size-of-percentalert-to-avoid-gcc-w.patch

59ea72
From 975898395951835f5a8051441af21cc995921f8c Mon Sep 17 00:00:00 2001
59ea72
From: Jes Sorensen <jsorensen@fb.com>
59ea72
Date: Thu, 31 May 2018 11:45:21 -0400
59ea72
Subject: [RHEL7.5 PATCH 18/26] Monitor: Increase size of percentalert to avoid
59ea72
 gcc warning
59ea72
59ea72
gcc-8.1 complains about truncated string operations. While we know
59ea72
percent will never grow larger than 100, it doesn't cost us anything
59ea72
to increase the size of 'percentalert' on the stack like this.
59ea72
59ea72
Signed-off-by: Jes Sorensen <jsorensen@fb.com>
59ea72
---
59ea72
 Monitor.c | 2 +-
59ea72
 1 file changed, 1 insertion(+), 1 deletion(-)
59ea72
59ea72
diff --git a/Monitor.c b/Monitor.c
59ea72
index c7c05d2..036103f 100644
59ea72
--- a/Monitor.c
59ea72
+++ b/Monitor.c
59ea72
@@ -557,7 +557,7 @@ static int check_array(struct state *st, struct mdstat_ent *mdstat,
59ea72
 		alert("RebuildStarted", dev, NULL, ainfo);
59ea72
 	if (st->percent >= 0 && mse->percent >= 0 &&
59ea72
 	    (mse->percent / increments) > (st->percent / increments)) {
59ea72
-		char percentalert[15];
59ea72
+		char percentalert[18];
59ea72
 		/*
59ea72
 		 * "RebuildNN" (10 chars) or "RebuildStarted" (15 chars)
59ea72
 		 */
59ea72
-- 
59ea72
2.7.4
59ea72