Thread (7 messages) 7 messages, 2 authors, 2019-08-19
STALE2478d
Revisions (2)
  1. v0 current
  2. v1 [diff vs current]

[PATCH rt-tests v0 2/4] sigwaittest: Increase buffer to avoid overflow

From: Daniel Wagner <hidden>
Date: 2019-08-16 06:42:24
Subsystem: the rest · Maintainer: Linus Torvalds

Increase the size of the char buffer. gcc 9.1.1 reports:

src/sigwaittest/sigwaittest.c:494:5: note: ‘sprintf’ output between 5 and 14 bytes into a destination of size 8
  494 |     sprintf(f_opt, "-fr%d", i);
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~
src/sigwaittest/sigwaittest.c:522:24: warning: ‘%d’ directive writing between 1 and 10 bytes into a region of size 5 [-Wformat-overflow=]
  522 |     sprintf(f_opt, "-fs%d", i);
      |                        ^~

Signed-off-by: Daniel Wagner <redacted>
---
 src/sigwaittest/sigwaittest.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/sigwaittest/sigwaittest.c b/src/sigwaittest/sigwaittest.c
index 59f28a5babcb..a98332f13e38 100644
--- a/src/sigwaittest/sigwaittest.c
+++ b/src/sigwaittest/sigwaittest.c
@@ -352,7 +352,7 @@ int main(int argc, char *argv[])
 	struct params *sender = NULL;
 	sigset_t sigset;
 	void *param = NULL;
-	char f_opt[8];
+	char f_opt[32];
 	struct timespec launchdelay, maindelay;
 
 	process_options(argc, argv);
-- 
2.21.0
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help