Blame SOURCES/irqbalance-1.4.0-Fix-an-possible-overflow-error.patch

d10306
From 16cb6df56960f58df61ec35ef3be45286eb3c788 Mon Sep 17 00:00:00 2001
d10306
From: Kairui Song <kasong@redhat.com>
d10306
Date: Sun, 2 Sep 2018 23:40:45 +0800
d10306
Subject: [PATCH 2/4] Fix an possible overflow error
d10306
d10306
Got:
d10306
"specified bound 2048 exceeds the size 19 of the destination"
d10306
when -O2 is used, and a "*** buffer overflow detected ***" error output
d10306
with no backtrace.
d10306
d10306
With -O0, it's gone, guess it's some gcc optimization problem, and the
d10306
size there is wrong anyway, this patch could fix it.
d10306
---
d10306
 irqbalance.c | 4 ++--
d10306
 1 file changed, 2 insertions(+), 2 deletions(-)
d10306
d10306
diff --git a/irqbalance.c b/irqbalance.c
d10306
index 4b3de54..c89c3c0 100644
d10306
--- a/irqbalance.c
d10306
+++ b/irqbalance.c
d10306
@@ -457,8 +457,8 @@ gboolean sock_handle(gint fd, GIOCondition condition, gpointer user_data __attri
d10306
 		}
d10306
 		if (!strncmp(buff, "setup", strlen("setup"))) {
d10306
 			char banned[512];
d10306
-			char *setup = calloc(strlen("SLEEP  ") + 11 +1, 1);
d10306
-			snprintf(setup, 2048, "SLEEP %d ", sleep_interval);
d10306
+			char *setup = calloc(strlen("SLEEP  ") + 11 + 1, 1);
d10306
+			snprintf(setup, strlen("SLEEP  ") + 11 + 1, "SLEEP %d ", sleep_interval);
d10306
 			if(g_list_length(cl_banned_irqs) > 0) {
d10306
 				for_each_irq(cl_banned_irqs, get_irq_data, setup);
d10306
 			}
d10306
-- 
d10306
2.17.1
d10306