Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Yann E. MORIN" <yann.morin.1998@free.fr>
To: Bernd Kuhls <bernd.kuhls@t-online.de>
Cc: Fabrice Fontaine <fontaine.fabrice@gmail.com>, buildroot@buildroot.org
Subject: Re: [Buildroot] [PATCH 1/1] package/liboping: fix build with ncurses-6.3
Date: Mon, 26 Dec 2022 09:44:46 +0100	[thread overview]
Message-ID: <20221226084446.GD2893@scaer> (raw)
In-Reply-To: <20221225231125.3955545-1-bernd.kuhls@t-online.de>

Bernd, All,

On 2022-12-26 00:11 +0100, Bernd Kuhls spake thusly:
> https://git.busybox.net/buildroot/commit/?id=a38a30eb3a46570705642dc37235ddcc1471b434
> bumped ncurses to version 6.3 which breaks build of liboping.
> 
> Signed-off-by: Bernd Kuhls <bernd.kuhls@t-online.de>

Applied to master, thanks.

Regards,
Yann E. MORIN.

> ---
>  ...ys-use-s-style-format-for-printf-sty.patch | 59 +++++++++++++++++++
>  1 file changed, 59 insertions(+)
>  create mode 100644 package/liboping/0005-src-oping.c-always-use-s-style-format-for-printf-sty.patch
> 
> diff --git a/package/liboping/0005-src-oping.c-always-use-s-style-format-for-printf-sty.patch b/package/liboping/0005-src-oping.c-always-use-s-style-format-for-printf-sty.patch
> new file mode 100644
> index 0000000000..3b68feea3d
> --- /dev/null
> +++ b/package/liboping/0005-src-oping.c-always-use-s-style-format-for-printf-sty.patch
> @@ -0,0 +1,59 @@
> +From 670834fd8fbd2533ea25ca83065800e924116579 Mon Sep 17 00:00:00 2001
> +From: Sergei Trofimovich <slyich@gmail.com>
> +Date: Mon, 15 Nov 2021 08:05:43 +0000
> +Subject: [PATCH] src/oping.c: always use "%s"-style format for
> + printf()-style functions
> +
> +`ncuses-6.3` added printf-style function attributes and now makes
> +it easier to catch cases when user input is used in palce of format
> +string when built with CFLAGS=-Werror=format-security:
> +
> +    oping.c:1265:41: error: format not a string literal and no format arguments [-Werror=format-security]
> +     1265 |                                         hist_symbols_utf8[index]);
> +          |                                         ^~~~~~~~~~~~~~~~~
> +
> +Let's wrap all the missing places with "%s" format.
> +
> +Downloaded from upstream PR https://github.com/octo/liboping/pull/61
> +
> +Signed-off-by: Bernd Kuhls <bernd.kuhls@t-online.de>
> +[Bernd: rebased for liboping version 1.10.0]
> +---
> + src/oping.c | 7 +++----
> + 1 file changed, 3 insertions(+), 4 deletions(-)
> +
> +diff --git a/src/oping.c b/src/oping.c
> +index c087c80..af4a0cb 100644
> +--- a/src/oping.c
> ++++ b/src/oping.c
> +@@ -1156,7 +1156,7 @@ static int update_graph_prettyping (ping_context_t *ctx, /* {{{ */
> + 			wattron (ctx->window, COLOR_PAIR(color));
> + 
> + 		if (has_utf8())
> +-			mvwprintw (ctx->window, /* y = */ 3, /* x = */ x + 2, symbol);
> ++			mvwprintw (ctx->window, /* y = */ 3, /* x = */ x + 2, "%s", symbol);
> + 		else
> + 			mvwaddch (ctx->window, /* y = */ 3, /* x = */ x + 2, symbolc);
> + 
> +@@ -1262,7 +1262,7 @@ static int update_graph_histogram (ping_context_t *ctx) /* {{{ */
> + 			mvwaddch (ctx->window, /* y = */ 3, /* x = */ x + 2, ' ');
> + 		else if (has_utf8 ())
> + 			mvwprintw (ctx->window, /* y = */ 3, /* x = */ x + 2,
> +-					hist_symbols_utf8[index]);
> ++					"%s", hist_symbols_utf8[index]);
> + 		else
> + 			mvwaddch (ctx->window, /* y = */ 3, /* x = */ x + 2,
> + 					hist_symbols_acs[index] | A_ALTCHARSET);
> +@@ -1639,8 +1639,7 @@ static void update_host_hook (pingobj_iter_t *iter, /* {{{ */
> + 
> + 			HOST_PRINTF ("%zu bytes from %s (%s): icmp_seq=%u ttl=%i ",
> + 					data_len, context->host, context->addr,
> +-					sequence, recv_ttl,
> +-					format_qos (recv_qos, recv_qos_str, sizeof (recv_qos_str)));
> ++					sequence, recv_ttl);
> + 			if ((recv_qos != 0) || (opt_send_qos != 0))
> + 			{
> + 				HOST_PRINTF ("qos=%s ",
> +-- 
> +2.34.1
> +
> -- 
> 2.34.1
> 
> _______________________________________________
> buildroot mailing list
> buildroot@buildroot.org
> https://lists.buildroot.org/mailman/listinfo/buildroot

-- 
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 561 099 427 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

      reply	other threads:[~2022-12-26  8:44 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-25 23:11 [Buildroot] [PATCH 1/1] package/liboping: fix build with ncurses-6.3 Bernd Kuhls
2022-12-26  8:44 ` Yann E. MORIN [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=20221226084446.GD2893@scaer \
    --to=yann.morin.1998@free.fr \
    --cc=bernd.kuhls@t-online.de \
    --cc=buildroot@buildroot.org \
    --cc=fontaine.fabrice@gmail.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