From patchwork Fri Mar 23 20:48:23 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Khem Raj X-Patchwork-Id: 132366 Delivered-To: patch@linaro.org Received: by 10.46.84.29 with SMTP id i29csp1052909ljb; Fri, 23 Mar 2018 13:48:36 -0700 (PDT) X-Google-Smtp-Source: AG47ELsup0MFPFIq+EYjomN97+vR9HfFXLH1AZz3+3rD9L5JCKNmV1tSRTE+f3opZJ4OVlWNU9j2 X-Received: by 10.99.127.75 with SMTP id p11mr21492999pgn.392.1521838116181; Fri, 23 Mar 2018 13:48:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521838116; cv=none; d=google.com; s=arc-20160816; b=dMmuOJlbY44JwrknItGTxtkBJ0h9aIneUKJh96I2D+0VHupFtsSjSHlcf/F0jHktIL wNgjwvU+6z9e6M/K6O7whKYkCZQoCdiBot77tBNtFZucaSgHft+UT9BYTY9g7X46c0Uc qItRFdBiGFQn1nOyH/sh66QXfJ43ygaXDLJflLzRCgBj2kpwIfEl5P0MIChWEIo2HzES qzj2dS67Dc798ih/OzGq35uOzG6AElNOqE7FEi2x2RifLK9quUwOuufIe9xjDdwOHbBB +2zhdpw/SEAR/omwqZwHQhXwwfHoHXDt2CZ0rQHiebVm544ql41ld0pCGIabpf+Qf7Fe aBZQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:sender:content-transfer-encoding:mime-version :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:message-id:date:to:from:dkim-signature :delivered-to:arc-authentication-results; bh=p6X3YxFzHrrbdruAfJ8dUK1dDgzYHjFykEq2AWuJumg=; b=aPois/cPpQLSep5ADjd3Twh7mtqaVsAKI/7tENz6fBopQj1HzU/i4KjTY/PLJU8d7l 1TUQAivrNT4otyGWue5bO2Yl22IpaU77JoHQjQoHyWNg54CGvdUVQfVLf6BZu3Hqenrh TIahPBllRInXDjI8MhiX+Dekbxop9UaWdX3UKfe4/ybnXGZ1Dl5ZSnb3mIlTYkBOy6VC D+AyydULav+YAV7TaMgDapdwPyLRJOGumC2cKrLXrM6XSOqkhEnfK63bqOkZ7ghnQU2I Epl7ndUHS9VhSkEEBu4OmsPiQehgXK3YTGwYFM7zuOpRsKCOkFmQ6EnNCyYLHLIAoilG 16IA== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20161025 header.b=am8O6+lI; spf=pass (google.com: best guess record for domain of openembedded-core-bounces@lists.openembedded.org designates 140.211.169.62 as permitted sender) smtp.mailfrom=openembedded-core-bounces@lists.openembedded.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from mail.openembedded.org (mail.openembedded.org. [140.211.169.62]) by mx.google.com with ESMTP id c20si7296772pfi.18.2018.03.23.13.48.35; Fri, 23 Mar 2018 13:48:36 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of openembedded-core-bounces@lists.openembedded.org designates 140.211.169.62 as permitted sender) client-ip=140.211.169.62; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20161025 header.b=am8O6+lI; spf=pass (google.com: best guess record for domain of openembedded-core-bounces@lists.openembedded.org designates 140.211.169.62 as permitted sender) smtp.mailfrom=openembedded-core-bounces@lists.openembedded.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from layers.openembedded.org (localhost [127.0.0.1]) by mail.openembedded.org (Postfix) with ESMTP id BD5F0788BB; Fri, 23 Mar 2018 20:48:31 +0000 (UTC) X-Original-To: openembedded-core@lists.openembedded.org Delivered-To: openembedded-core@lists.openembedded.org Received: from mail-pg0-f66.google.com (mail-pg0-f66.google.com [74.125.83.66]) by mail.openembedded.org (Postfix) with ESMTP id 75CC9788A0 for ; Fri, 23 Mar 2018 20:48:30 +0000 (UTC) Received: by mail-pg0-f66.google.com with SMTP id n11so5017324pgp.4 for ; Fri, 23 Mar 2018 13:48:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=cubZeYtJA0LxfDrWlwmD1rNM5+GiSIbaciRcAtTgXII=; b=am8O6+lIGXAPuIam0v5JnUdoxFcbe2hINcCuLRLpa151p0iD/b+G/icBlAqPaCBi+0 zdfuUe9vF/KHDGEgrKAzb9mQwpg9dgq2JBTsymlPJIuN4Q/uMR/H1svjyyA9s+tWVBig 7Sxhaqgpj1s8Xh716wi9+diTr6wB/EffCfk1C2hLB0Wtb2zkwrFi8paHnFgfwuoUi/p7 Y63KN2adMb01gg5n76HYfBpJB9Hgw0fFpWY7Pr4CES8bkmDqL9XUietbzAIJK6Q8XTIN b+TQ9PaLvmU+7qKmYr0A/sg7QrgiJurt/F0C9y1GTX3Fn62X9lsOxIxPiYsjwLgCEhg9 4Mgw== 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=cubZeYtJA0LxfDrWlwmD1rNM5+GiSIbaciRcAtTgXII=; b=o9RWOEihM/K0h6ylDQ6K4qs9kEqVAMy2je19pYD6/l0H0IjpreICuCY0lRqNXd+Asf me4dfhlwiSkgSxLQfQElZKPM0w19NzNPW/f9Jxj4uwePvJcBmt/6xhCHkMdl1cM/p3Np VLI0xrZPs/7jrSe8jWMqvfqTj+RrfN7OahnB3tYK/LhDWNk7FaRCLtLKrN/wErx4DJIg qtyJ8lTLogA6QrnjcHhgqvr8aoSJeNGv+pKebh/DQ+XYA6nvsYZbRmcOsqCR0fdQSj3E qzmphJsTI5FDffqiG48/RgEfer333reze8Rzf+D6vh7JnDaMt/cSccwkR3nxrdOFh4Un gBUA== X-Gm-Message-State: AElRT7HZfqAWoiQ2Tai94MbLiG7MXbFjapc9JHGj5vz7ooJBEMNT5tM7 EXKkPX4dZ5Q++yZnj8NxxV/eKw== X-Received: by 10.99.37.70 with SMTP id l67mr18144925pgl.106.1521838111457; Fri, 23 Mar 2018 13:48:31 -0700 (PDT) Received: from localhost.localdomain ([2601:646:8880:466c:6245:cbff:fe64:591]) by smtp.gmail.com with ESMTPSA id g85sm13706369pfd.109.2018.03.23.13.48.30 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 23 Mar 2018 13:48:30 -0700 (PDT) From: Khem Raj To: openembedded-core@lists.openembedded.org Date: Fri, 23 Mar 2018 13:48:23 -0700 Message-Id: <20180323204823.4634-1-raj.khem@gmail.com> X-Mailer: git-send-email 2.16.2 Subject: [OE-core] [PATCH V2 2/3] glibc: Replace strncpy with memccpy to fix -Wstringop-truncation. X-BeenThere: openembedded-core@lists.openembedded.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: Patches and discussions about the oe-core layer List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: openembedded-core-bounces@lists.openembedded.org Errors-To: openembedded-core-bounces@lists.openembedded.org Signed-off-by: Khem Raj --- Changes since v1: - Add Sign-off field ...ncpy-with-memccpy-to-fix-Wstringop-trunca.patch | 40 ++++++++++++++++++++++ meta/recipes-core/glibc/glibc_2.27.bb | 1 + 2 files changed, 41 insertions(+) create mode 100644 meta/recipes-core/glibc/glibc/0029-Replace-strncpy-with-memccpy-to-fix-Wstringop-trunca.patch -- 2.16.2 -- _______________________________________________ Openembedded-core mailing list Openembedded-core@lists.openembedded.org http://lists.openembedded.org/mailman/listinfo/openembedded-core diff --git a/meta/recipes-core/glibc/glibc/0029-Replace-strncpy-with-memccpy-to-fix-Wstringop-trunca.patch b/meta/recipes-core/glibc/glibc/0029-Replace-strncpy-with-memccpy-to-fix-Wstringop-trunca.patch new file mode 100644 index 0000000000..fa29f4165b --- /dev/null +++ b/meta/recipes-core/glibc/glibc/0029-Replace-strncpy-with-memccpy-to-fix-Wstringop-trunca.patch @@ -0,0 +1,40 @@ +From 113e0516fbd3ce18253f0423762416d4c4b38fb0 Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Thu, 22 Mar 2018 17:57:37 -0700 +Subject: [PATCH 29/29] Replace strncpy with memccpy to fix + -Wstringop-truncation. + + * nis/nss_nisplus/nisplus-parser.c: Replace strncpy with memcpy to + avoid -Wstringop-truncation. +--- +Signed-off-by: Khem Raj +Upstream-Status: Submitted [https://sourceware.org/ml/libc-alpha/2018-03/msg00531.html] + + nis/nss_nisplus/nisplus-parser.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/nis/nss_nisplus/nisplus-parser.c b/nis/nss_nisplus/nisplus-parser.c +index 8dc021e73d..b53284f889 100644 +--- a/nis/nss_nisplus/nisplus-parser.c ++++ b/nis/nss_nisplus/nisplus-parser.c +@@ -87,7 +87,7 @@ _nss_nisplus_parse_pwent (nis_result *result, struct passwd *pw, + if (len >= room_left) + goto no_more_room; + +- strncpy (first_unused, numstr, len); ++ memcpy (first_unused, numstr, len); + first_unused[len] = '\0'; + numstr = first_unused; + } +@@ -103,7 +103,7 @@ _nss_nisplus_parse_pwent (nis_result *result, struct passwd *pw, + if (len >= room_left) + goto no_more_room; + +- strncpy (first_unused, numstr, len); ++ memcpy (first_unused, numstr, len); + first_unused[len] = '\0'; + numstr = first_unused; + } +-- +2.16.2 + diff --git a/meta/recipes-core/glibc/glibc_2.27.bb b/meta/recipes-core/glibc/glibc_2.27.bb index 4f6f58ccb1..4a461ab283 100644 --- a/meta/recipes-core/glibc/glibc_2.27.bb +++ b/meta/recipes-core/glibc/glibc_2.27.bb @@ -43,6 +43,7 @@ SRC_URI = "${GLIBC_GIT_URI};branch=${SRCBRANCH};name=glibc \ file://0026-reset-dl_load_write_lock-after-forking.patch \ file://0027-Acquire-ld.so-lock-before-switching-to-malloc_atfork.patch \ file://0028-bits-siginfo-consts.h-enum-definition-for-TRAP_HWBKP.patch \ + file://0029-Replace-strncpy-with-memccpy-to-fix-Wstringop-trunca.patch \ " NATIVESDKFIXES ?= ""