Linux Test Project
 help / color / mirror / Atom feed
From: Petr Vorel <pvorel@suse.cz>
To: ltp@lists.linux.it
Subject: [LTP] [PATCH 2/2] tst_net_vars.c: Enlarge buffer to fix format overflow warnings
Date: Mon, 20 May 2019 17:34:11 +0200	[thread overview]
Message-ID: <20190520153411.GA14132@dell5510> (raw)
In-Reply-To: <20190509164125.619-2-pvorel@suse.cz>

Hi,

> tst_net_vars.c:230:18: warning: ‘.0.0’ directive writing 4 bytes into a region of size between 1 and 128 [-Wformat-overflow=]
>   sprintf(buf, "%s.0.0", net_unused);
>                   ^~~~
> In file included from /usr/include/stdio.h:867,
>                  from tst_net_vars.c:26:
> /usr/include/bits/stdio2.h:36:10: note: ‘__builtin___sprintf_chk’ output between 5 and 132 bytes into a destination of size 128

> tst_net_vars.c:294:18: warning: ‘::’ directive writing 2 bytes into a region of size between 1 and 128 [-Wformat-overflow=]
>   sprintf(buf, "%s::", net_unused);
>                   ^~
> In file included from /usr/include/stdio.h:867,
>                  from tst_net_vars.c:26:
> /usr/include/bits/stdio2.h:36:10: note: ‘__builtin___sprintf_chk’ output between 3 and 130 bytes into a destination of size 128

> Fixes: d18e135d0 ("network: Add tools for setup IP related environment
> variables")

> Signed-off-by: Petr Vorel <pvorel@suse.cz>
> ---
>  testcases/lib/tst_net_vars.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)

Both commits pushed.

Kind regards,
Petr

      reply	other threads:[~2019-05-20 15:34 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-09 16:41 [LTP] [PATCH 1/2] tst_net_vars.c: Fix size for IPv4 address buffer Petr Vorel
2019-05-09 16:41 ` [LTP] [PATCH 2/2] tst_net_vars.c: Enlarge buffer to fix format overflow warnings Petr Vorel
2019-05-20 15:34   ` Petr Vorel [this message]

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=20190520153411.GA14132@dell5510 \
    --to=pvorel@suse.cz \
    --cc=ltp@lists.linux.it \
    /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