dcavalca / rpms / mdadm

Forked from rpms/mdadm 3 years ago
Clone

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

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