Skip to content

src/oping.c: always use "%s"-style format for printf()-style functions#61

Open
trofi wants to merge 1 commit intoocto:masterfrom
trofi:master
Open

src/oping.c: always use "%s"-style format for printf()-style functions#61
trofi wants to merge 1 commit intoocto:masterfrom
trofi:master

Conversation

@trofi
Copy link

@trofi trofi commented Nov 15, 2021

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.

`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.
hnyman added a commit to hnyman/packages that referenced this pull request Mar 20, 2022
Fix compilation with ncurses 6.3 by adjusting the printf format strings.

Apparently ncurses 6.3 introduced some new formatting tweaks that
broke things.

Fixes openwrt#18110

Reference to:
* octo/liboping#62
* octo/liboping#61
* https://salsa.debian.org/debian/liboping/-/blob/debian/debian/patches/fix_HOST_PRINTF_format_string.patch

Signed-off-by: Hannu Nyman <hannu.nyman@iki.fi>
hnyman added a commit to hnyman/packages that referenced this pull request Mar 20, 2022
Fix compilation with ncurses 6.3 by adjusting the printf format strings.

Apparently ncurses 6.3 introduced some new formatting tweaks that
broke things.

Fixes openwrt#18110

Reference to:
* octo/liboping#62
* octo/liboping#61
* https://salsa.debian.org/debian/liboping/-/blob/debian/debian/patches/fix_HOST_PRINTF_format_string.patch

Signed-off-by: Hannu Nyman <hannu.nyman@iki.fi>
(cherry picked from commit cb4d8cc)
Beginner-Go pushed a commit to coolsnowwolf/packages that referenced this pull request Mar 21, 2022
Fix compilation with ncurses 6.3 by adjusting the printf format strings.

Apparently ncurses 6.3 introduced some new formatting tweaks that
broke things.

Fixes #18110

Reference to:
* octo/liboping#62
* octo/liboping#61
* https://salsa.debian.org/debian/liboping/-/blob/debian/debian/patches/fix_HOST_PRINTF_format_string.patch

Signed-off-by: Hannu Nyman <hannu.nyman@iki.fi>
1715173329 pushed a commit to immortalwrt/packages that referenced this pull request Mar 25, 2022
Fix compilation with ncurses 6.3 by adjusting the printf format strings.

Apparently ncurses 6.3 introduced some new formatting tweaks that
broke things.

Fixes #18110

Reference to:
* octo/liboping#62
* octo/liboping#61
* https://salsa.debian.org/debian/liboping/-/blob/debian/debian/patches/fix_HOST_PRINTF_format_string.patch

Signed-off-by: Hannu Nyman <hannu.nyman@iki.fi>
(cherry picked from commit cb4d8cc)
@brd
Copy link

brd commented Aug 12, 2024

This works for me.. @octo Can it be merged?

freebsd-git pushed a commit to freebsd/freebsd-ports that referenced this pull request Aug 12, 2024
Pulled from octo/liboping#61

PR:		280780
Approved by:	garga
Sponsored by:	Rubicon Communications, LLC ("Netgate")
nanorkyo pushed a commit to nanorkyo/freebsd-ports that referenced this pull request Aug 21, 2024
Pulled from octo/liboping#61

PR:		280780
Approved by:	garga
Sponsored by:	Rubicon Communications, LLC ("Netgate")
kwitaszczyk pushed a commit to CTSRD-CHERI/cheribsd-ports that referenced this pull request Jan 9, 2026
Pulled from octo/liboping#61

PR:		280780
Approved by:	garga
Sponsored by:	Rubicon Communications, LLC ("Netgate")

(cherry picked from commit 6e99116)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants