Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

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 <[email protected]>
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 <[email protected]>
(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 <[email protected]>
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 <[email protected]>
(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")
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