linux-rt-users.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Daniel Wagner <wagi@monom.org>
To: Clark Williams <williams@redhat.com>, John Kacur <jkacur@redhat.com>
Cc: linux-rt-users@vger.kernel.org, Daniel Wagner <wagi@monom.org>
Subject: [PATCH rt-tests v1 v1 2/4] sigwaittest: Increase buffer to avoid overflow
Date: Mon, 19 Aug 2019 08:43:02 +0200	[thread overview]
Message-ID: <20190819064304.4676-3-wagi@monom.org> (raw)
In-Reply-To: <20190819064304.4676-1-wagi@monom.org>

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 <wagi@monom.org>
---
 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..2d0c04132fa7 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[14];
 	struct timespec launchdelay, maindelay;
 
 	process_options(argc, argv);
-- 
2.21.0

  parent reply	other threads:[~2019-08-19  6:43 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-19  6:43 [PATCH rt-tests v1 v1 0/4] Fix gcc warning Daniel Wagner
2019-08-19  6:43 ` [PATCH rt-tests v1 v1 1/4] pmqtest: Increase buffer to avoid overflow Daniel Wagner
2019-08-23 15:15   ` John Kacur
2019-08-19  6:43 ` Daniel Wagner [this message]
2019-08-23 15:17   ` [PATCH rt-tests v1 v1 2/4] sigwaittest: " John Kacur
2019-08-19  6:43 ` [PATCH rt-tests v1 v1 3/4] svsematest: " Daniel Wagner
2019-08-23 15:19   ` John Kacur
2019-08-19  6:43 ` [PATCH rt-tests v1 v1 4/4] deadline_test: " Daniel Wagner
2019-08-23 15:20   ` John Kacur

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190819064304.4676-3-wagi@monom.org \
    --to=wagi@monom.org \
    --cc=jkacur@redhat.com \
    --cc=linux-rt-users@vger.kernel.org \
    --cc=williams@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).