Skip to content

Commit

Permalink
community/liboping: Use debian version of the patch
Browse files Browse the repository at this point in the history
Fixes even more format string issues.

See octo/liboping#60 (comment)
  • Loading branch information
nmeum committed Feb 22, 2022
1 parent a6369d7 commit 0bf791f
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 11 deletions.
4 changes: 2 additions & 2 deletions community/liboping/APKBUILD
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# Maintainer: Natanael Copa <[email protected]>
pkgname=liboping
pkgver=1.10.0
pkgrel=0
pkgrel=1
pkgdesc="A C library to generate ICMP echo requests"
url="http://verplant.org/liboping/"
arch="all"
Expand Down Expand Up @@ -34,5 +34,5 @@ package() {

sha512sums="
f1e9984cf0c1df89b29f7bc657c19a5439019db7643680744d8f353664b6a53070581f40b51e72f896c7df88799c6868257f6308e1a9d84b4d2a0666491214d8 liboping-1.10.0.tar.bz2
e6d47dee256f525deb8f1ba5725d383dc1a7ff27e1d5f6138aeda989cf282a165efc3510afad1140d7a1a5e92760317d22d7753ba75d76c30ade9154316195de fix-format-string.patch
4fe4b25e6213406f224086ed83fcd4dac7996766545e4a18c73def1035fc7729e2dc4a7d8abfe8cdf48484e1d9af59abfc7483aa1e5f59a0aa316d647490bad2 fix-format-string.patch
"
33 changes: 24 additions & 9 deletions community/liboping/fix-format-string.patch
Original file line number Diff line number Diff line change
@@ -1,15 +1,30 @@
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 the following commit:
See:

https://github.com/octo/liboping/commit/66464b61f8ee756dcfc0081944f4367da2b1a6ab

See https://github.com/octo/liboping/pull/60
* https://github.com/octo/liboping/pull/60
* https://bugs.debian.org/997189
* https://salsa.debian.org/debian/liboping/-/blob/debian/debian/patches/fix_HOST_PRINTF_format_string.patch

diff -upr liboping-1.10.0.orig/src/oping.c liboping-1.10.0/src/oping.c
--- liboping-1.10.0.orig/src/oping.c 2021-10-24 13:13:36.850533766 +0200
+++ liboping-1.10.0/src/oping.c 2021-10-24 13:13:49.790711547 +0200
--- liboping-1.10.0.orig/src/oping.c 2022-02-22 20:17:48.000000000 +0100
+++ liboping-1.10.0/src/oping.c 2022-02-22 20:22:23.000000000 +0100
@@ -1125,7 +1125,7 @@ static int update_graph_prettyping (ping
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);

@@ -1223,7 +1223,7 @@ static int update_graph_histogram (ping_
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);
@@ -1600,8 +1600,7 @@ static void update_host_hook (pingobj_it

HOST_PRINTF ("%zu bytes from %s (%s): icmp_seq=%u ttl=%i ",
Expand Down

0 comments on commit 0bf791f

Please sign in to comment.