]> git.ipfire.org Git - ipfire-3.x.git/blob - liboping/patches/liboping-1.10.0-ncurses-6.3.patch
json-c: Update to version 0.17-20230812
[ipfire-3.x.git] / liboping / patches / liboping-1.10.0-ncurses-6.3.patch
1 From 609559aa3b257a5eb627717d870dfce336f941ec Mon Sep 17 00:00:00 2001
2 From: Sergei Trofimovich <slyich@gmail.com>
3 Date: Mon, 15 Nov 2021 08:05:43 +0000
4 Subject: [PATCH] src/oping.c: always use "%s"-style format for printf()-style
5 functions
6
7 `ncuses-6.3` added printf-style function attributes and now makes
8 it easier to catch cases when user input is used in palce of format
9 string when built with CFLAGS=-Werror=format-security:
10
11 oping.c:1265:41: error: format not a string literal and no format arguments [-Werror=format-security]
12 1265 | hist_symbols_utf8[index]);
13 | ^~~~~~~~~~~~~~~~~
14
15 Let's wrap all the missing places with "%s" format.
16 ---
17 src/oping.c | 7 +++----
18 1 file changed, 3 insertions(+), 4 deletions(-)
19
20 diff --git a/src/oping.c b/src/oping.c
21 index c087c80..af4a0cb 100644
22 --- a/src/oping.c
23 +++ b/src/oping.c
24 @@ -1156,7 +1156,7 @@ static int update_graph_prettyping (ping_context_t *ctx, /* {{{ */
25 wattron (ctx->window, COLOR_PAIR(color));
26
27 if (has_utf8())
28 - mvwprintw (ctx->window, /* y = */ 3, /* x = */ x + 2, symbol);
29 + mvwprintw (ctx->window, /* y = */ 3, /* x = */ x + 2, "%s", symbol);
30 else
31 mvwaddch (ctx->window, /* y = */ 3, /* x = */ x + 2, symbolc);
32
33 @@ -1262,7 +1262,7 @@ static int update_graph_histogram (ping_context_t *ctx) /* {{{ */
34 mvwaddch (ctx->window, /* y = */ 3, /* x = */ x + 2, ' ');
35 else if (has_utf8 ())
36 mvwprintw (ctx->window, /* y = */ 3, /* x = */ x + 2,
37 - hist_symbols_utf8[index]);
38 + "%s", hist_symbols_utf8[index]);
39 else
40 mvwaddch (ctx->window, /* y = */ 3, /* x = */ x + 2,
41 hist_symbols_acs[index] | A_ALTCHARSET);
42 @@ -1639,8 +1639,7 @@ static void update_host_hook (pingobj_iter_t *iter, /* {{{ */
43
44 HOST_PRINTF ("%zu bytes from %s (%s): icmp_seq=%u ttl=%i ",
45 data_len, context->host, context->addr,
46 - sequence, recv_ttl,
47 - format_qos (recv_qos, recv_qos_str, sizeof (recv_qos_str)));
48 + sequence, recv_ttl);
49 if ((recv_qos != 0) || (opt_send_qos != 0))
50 {
51 HOST_PRINTF ("qos=%s ",