From bb097c543845375c4c347cc09d57bdcb5343a0fd Mon Sep 17 00:00:00 2001 From: Michael Tremer Date: Fri, 21 Jun 2019 01:04:39 +0100 Subject: [PATCH] liboping: Fix build with GCC 9 Signed-off-by: Michael Tremer --- liboping/liboping.nm | 8 +++--- ...to-make-GCC-s-truncation-check-happy.patch | 28 +++++++++++++++++++ 2 files changed, 32 insertions(+), 4 deletions(-) create mode 100644 liboping/patches/ping_host_add-Decrease-buffer-size-to-make-GCC-s-truncation-check-happy.patch diff --git a/liboping/liboping.nm b/liboping/liboping.nm index a4b42984d..127522717 100644 --- a/liboping/liboping.nm +++ b/liboping/liboping.nm @@ -4,11 +4,11 @@ ############################################################################### name = liboping -version = 1.8.0 -release = 1 +version = 1.10.0 +release = 2 groups = Development/Tools -url = http://noping.cc/ +url = https://noping.cc/ license = LGPLv2.1 and GPLv2 summary = liboping is a C library to generate ICMP echo requests @@ -21,7 +21,7 @@ description fping rolled into one. end -source_dl = http://noping.cc/files/ +source_dl = https://noping.cc/files/ build requires diff --git a/liboping/patches/ping_host_add-Decrease-buffer-size-to-make-GCC-s-truncation-check-happy.patch b/liboping/patches/ping_host_add-Decrease-buffer-size-to-make-GCC-s-truncation-check-happy.patch new file mode 100644 index 000000000..a7b3a3edd --- /dev/null +++ b/liboping/patches/ping_host_add-Decrease-buffer-size-to-make-GCC-s-truncation-check-happy.patch @@ -0,0 +1,28 @@ +From 18ca43507b351f339ff23062541ee8d58e813a53 Mon Sep 17 00:00:00 2001 +From: Florian Forster +Date: Sun, 29 Jul 2018 14:34:19 +0200 +Subject: [PATCH] ping_host_add: Decrease buffer size to make GCC's truncation + check happy. + +Fixes: #38 +--- + src/liboping.c | 6 ++---- + 1 file changed, 2 insertions(+), 4 deletions(-) + +diff --git a/src/liboping.c b/src/liboping.c +index 5253e8c..2470988 100644 +--- a/src/liboping.c ++++ b/src/liboping.c +@@ -1636,10 +1636,8 @@ int ping_host_add (pingobj_t *obj, const char *host) + } + else + { +- char errmsg[PING_ERRMSG_LEN]; +- +- snprintf (errmsg, PING_ERRMSG_LEN, "Unknown `ai_family': %i", ai_ptr->ai_family); +- errmsg[PING_ERRMSG_LEN - 1] = '\0'; ++ char errmsg[64]; ++ snprintf (errmsg, sizeof(errmsg), "Unknown `ai_family': %d", ai_ptr->ai_family); + + dprintf ("%s", errmsg); + ping_set_error (obj, "getaddrinfo", errmsg);