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

Fix HOST_PRINTF format string #60

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

Conversation

nmeum
Copy link

@nmeum nmeum commented Oct 24, 2021

Without this patch the printf invocation takes more argument that it has format strings, since the format_qos() output string is printed in the if statement following the HOST_PRINTF invocation, I believe this to be an accidental error made in 66464b6 (this commit removes the format from the format string but doesn't remove the argument).

Without this patch the printf invocation takes more argument that it has
format strings, since the format_qos() output string is printed in the
if statement following the HOST_PRINTF invocation, I believe this to be
an accidental error made in 66464b6.
@xtaran
Copy link

xtaran commented Feb 6, 2022

This also affects liboping in Debian, but there are actually more such issues than this pull request fixes. The remaining issues are:

oping.c: In function ‘update_graph_prettyping’:
oping.c:1159:25: error: format not a string literal and no format arguments [-Werror=format-security]
 1159 |                         mvwprintw (ctx->window, /* y = */ y_max, /* x = */ x + 2, symbol);
      |                         ^~~~~~~~~
oping.c: In function ‘update_graph_histogram’:
oping.c:1265:41: error: format not a string literal and no format arguments [-Werror=format-security]
 1265 |                                         hist_symbols_utf8[index]);
      |                                         ^~~~~~~~~~~~~~~~~
libtool: compile:  gcc -DHAVE_CONFIG_H -I. -Wdate-time -D_FORTIFY_SOURCE=2 -Wall -Werror -g -O2 -ffile-prefix-map=/home/abe/debian/NMU/liboping=. -fstack-protector-strong -Wformat -Werror=format-security -c liboping.c -o liboping_la-liboping.o >/dev/null 2>&1
cc1: all warnings being treated as errors

@bzed
Copy link

bzed commented Feb 22, 2022

https://salsa.debian.org/debian/liboping/-/blob/debian/debian/patches/fix_HOST_PRINTF_format_string.patch should fix all issues, you might want to use that instead of the PR.

algitbot pushed a commit to alpinelinux/aports that referenced this pull request Feb 22, 2022
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.

3 participants