40 lines
1.3 KiB
Diff
40 lines
1.3 KiB
Diff
|
From 06519443224b7da5b336040f07bff8f929148426 Mon Sep 17 00:00:00 2001
|
|||
|
From: Daniel Wagner <wagi@monom.org>
|
|||
|
Date: Mon, 19 Aug 2019 08:43:03 +0200
|
|||
|
Subject: [PATCH 03/10] svsematest: Increase buffer to avoid overflow
|
|||
|
MIME-Version: 1.0
|
|||
|
Content-Type: text/plain; charset=UTF-8
|
|||
|
Content-Transfer-Encoding: 8bit
|
|||
|
|
|||
|
Increase the size of the char buffer. gcc 9.1.1 reports:
|
|||
|
|
|||
|
rc/svsematest/svsematest.c:578:24: warning: ‘%d’ directive writing between 1 and 10 bytes into a region of size 5 [-Wformat-overflow=]
|
|||
|
578 | sprintf(f_opt, "-fr%d", i);
|
|||
|
| ^~
|
|||
|
src/svsematest/svsematest.c:606:5: note: ‘sprintf’ output between 5 and 14 bytes into a destination of size 8
|
|||
|
606 | sprintf(f_opt, "-fs%d", i);
|
|||
|
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
|
|||
|
|
|||
|
Signed-off-by: Daniel Wagner <wagi@monom.org>
|
|||
|
Signed-off-by: John Kacur <jkacur@redhat.com>
|
|||
|
---
|
|||
|
src/svsematest/svsematest.c | 2 +-
|
|||
|
1 file changed, 1 insertion(+), 1 deletion(-)
|
|||
|
|
|||
|
diff --git a/src/svsematest/svsematest.c b/src/svsematest/svsematest.c
|
|||
|
index 8f880786ec0f..15e36af76288 100644
|
|||
|
--- a/src/svsematest/svsematest.c
|
|||
|
+++ b/src/svsematest/svsematest.c
|
|||
|
@@ -401,7 +401,7 @@ int main(int argc, char *argv[])
|
|||
|
struct params *sender = NULL;
|
|||
|
sigset_t sigset;
|
|||
|
void *param = NULL;
|
|||
|
- char f_opt[8];
|
|||
|
+ char f_opt[14];
|
|||
|
struct timespec launchdelay, maindelay;
|
|||
|
|
|||
|
myfile = getenv("_");
|
|||
|
--
|
|||
|
2.20.1
|
|||
|
|