From patchwork Thu Dec 6 22:39:09 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabrice Fontaine X-Patchwork-Id: 1009066 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=busybox.net (client-ip=140.211.166.136; helo=silver.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="PAgZ3pIl"; dkim-atps=neutral Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 439rC55TRkz9s55 for ; Fri, 7 Dec 2018 09:40:01 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id DE6AB22888; Thu, 6 Dec 2018 22:39:58 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id iGnKTLIjXs+e; Thu, 6 Dec 2018 22:39:57 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by silver.osuosl.org (Postfix) with ESMTP id 0946A2274B; Thu, 6 Dec 2018 22:39:57 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) by ash.osuosl.org (Postfix) with ESMTP id ED1841C2780 for ; Thu, 6 Dec 2018 22:39:55 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id 76FD484F1B for ; Thu, 6 Dec 2018 22:39:40 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id yyP6a8PMYPGb for ; Thu, 6 Dec 2018 22:39:39 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-wr1-f43.google.com (mail-wr1-f43.google.com [209.85.221.43]) by fraxinus.osuosl.org (Postfix) with ESMTPS id E75E384E7C for ; Thu, 6 Dec 2018 22:39:38 +0000 (UTC) Received: by mail-wr1-f43.google.com with SMTP id z5so2014242wrt.11 for ; Thu, 06 Dec 2018 14:39:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=mNZtmhhLiL7XxmNqjgu2R0xfLri5bvG/bMS4W9V93G0=; b=PAgZ3pIlE2qRYAHkpskJ7Jpsw8y5JI9gjiKkvfUROp9rM6rU9G22TA8qTOJFsuwspe IQ+UMQGqnpOXfxQ+LwQhp/Jk4AyJIF7Jypct2+nT2EKHmBQxs/XFhTFb9CfOsQcP0gYH 1MtG8In+DhQ8gjTx/8PrdErDE9GvLa1ArFzbvD6SrNurwpCa0Qb84bkGe8ZkfUmyJdKW JTaQYcrgF6Q2EC/jQqLNTebmflDKsJm9klozuFmchW0/U0vkY+jfe0DtI74q3yC9mHpA 93I0T30RVrdHNdKRaLU3T8Ky1a3idz+Flj4MY9yV7ZI6/LVBeHIjbA994vag9VZHVJL4 1efw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=mNZtmhhLiL7XxmNqjgu2R0xfLri5bvG/bMS4W9V93G0=; b=LN68aZaSHrGj34gKKo8rjea5rQwWHROTWfUy5KPpODJDJO8a1c1Q7n8zEtRYYmF7nA SpXpEnz/8eAHMnn8vMXRmlaMu0GXUPobAWduMu+OXwdzT/W3ueCywXfTw4HTOcfgSpSg Zav1GHyb+UmrghPcggDsTIrHgPQyxfoAoVxnzPhfm1eQ+glM22Ccsl2wwxgnucc58oxN tVgJomjDzWQuzhgtoyFYFG8bHSytMGTtT3m2qyHDbWV8x/IWXhtmLvLhag0CdJKpEvBs KJGhoq09hvyxuKceyY6r3NzeOaljGrryT1coEQRn8UvmBbWM2FpCHMBZDwBU8WE68DCp yYFw== X-Gm-Message-State: AA+aEWZKInRnbk6BscqqyBD1nbj2aHZKyB6Hnd1TB3FsB+S+QTOrUKDI cRoi9B7i6LokHCuxhTFPEyOXC2N0 X-Google-Smtp-Source: AFSGD/XE4SApEFWR7rBul2E4ov4KguXkN1ntxa0BTyzfgyOsFzzn4+mBJpSuRvcHBn9I2guH0CIJDQ== X-Received: by 2002:adf:ea11:: with SMTP id q17mr25754367wrm.328.1544135977053; Thu, 06 Dec 2018 14:39:37 -0800 (PST) Received: from localhost.localdomain ([92.184.105.94]) by smtp.gmail.com with ESMTPSA id l20sm2830155wrb.93.2018.12.06.14.39.36 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 06 Dec 2018 14:39:36 -0800 (PST) From: Fabrice Fontaine To: buildroot@buildroot.org Date: Thu, 6 Dec 2018 23:39:09 +0100 Message-Id: <20181206223909.23161-1-fontaine.fabrice@gmail.com> X-Mailer: git-send-email 2.14.1 Subject: [Buildroot] [PATCH 1/1] liboping: fix format-truncation error X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Fabrice Fontaine MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" liboping.c: In function 'ping_host_add': liboping.c:207:9: error: '%s' directive output may be truncated writing up to 255 bytes into a region of size 243 [-Werror=format-truncation=] "%s: %s", function, message); ^~ liboping.c:1644:40: ping_set_error (obj, "getaddrinfo", errmsg); ~~~~~~ liboping.c:206:2: note: 'snprintf' output between 14 and 269 bytes into a destination of size 256 snprintf (obj->errmsg, sizeof (obj->errmsg), ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ "%s: %s", function, message); Fixes: - http://autobuild.buildroot.org/results/b12d86388b495a96194e0bcbb5c19a4e35cbc53d Signed-off-by: Fabrice Fontaine --- ...size-to-make-GCC-s-truncation-check-happy.patch | 31 ++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 package/liboping/0001-ping_host_add-Decrease-buffer-size-to-make-GCC-s-truncation-check-happy.patch diff --git a/package/liboping/0001-ping_host_add-Decrease-buffer-size-to-make-GCC-s-truncation-check-happy.patch b/package/liboping/0001-ping_host_add-Decrease-buffer-size-to-make-GCC-s-truncation-check-happy.patch new file mode 100644 index 0000000000..b0aca8a715 --- /dev/null +++ b/package/liboping/0001-ping_host_add-Decrease-buffer-size-to-make-GCC-s-truncation-check-happy.patch @@ -0,0 +1,31 @@ +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 +Signed-off-by: Fabrice Fontaine +[Retrieved from: +https://github.com/octo/liboping/commit/18ca43507b351f339ff23062541ee8d58e813a53] +--- + 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);