From patchwork Fri Mar 23 13:34:44 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Khem Raj X-Patchwork-Id: 132342 Delivered-To: patch@linaro.org Received: by 10.46.84.29 with SMTP id i29csp604581ljb; Fri, 23 Mar 2018 06:35:11 -0700 (PDT) X-Google-Smtp-Source: AG47ELvWGcRPXyFAgHeb4y+tgDpD79aKERTKstJQWAJ9Lz4K/jihSDySF7X4axG2FpZfdKuQ3uSR X-Received: by 10.99.152.10 with SMTP id q10mr10032209pgd.40.1521812111128; Fri, 23 Mar 2018 06:35:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521812111; cv=none; d=google.com; s=arc-20160816; b=qPyWH6YsYrCM+qNPhA/DmANYBaD4m0BDeZoSnQNspk2N+0DzP1H5riDdtnbqhg1v7d BHalzP8Q57By3dIj3dhjf1zYwvx9kd14DF6Rqxc9zhyw4pDAH5MuMr5WoBgNJ6KB66yh t4v+/2ZMRZ1THTD7iGP88lm/8fZdfxaqcsfU9Qq/074uB7Vses8Ap7Ph0/ZYgOLir+pO t5I812mi0+MURapQHbpu5RbdmPYbVAX7SUYHi5YJF/HXPgFkMIsJI/ACqEv2mK7ZZ6XB uqD71ResoRpWx079koJ2o05TDV7poYi2OQoJt3BuNhSLkbaKJU8fLlex6futRs3ek4mw 4UEQ== 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:references:in-reply-to:message-id:date :to:from:dkim-signature:delivered-to:arc-authentication-results; bh=LXyTJOgfqStXYOvXcXJCUllxiONuJZ17xJmmCMYlgGs=; b=RfsCVrXizlF/L9MDBSkR1odSmRJXZNwYt4OtG+9yuTZCDDwCBXeREjw84CU+gOvXnl cf2BaluvmS4Yzog6BAqNrIWwXTsE7Vm9uVgOCM+JzxNfJV7Sjts4pTvtqMmNrRsUuThZ Cu/+Szn8td9ycYUIjGUIAAIZCyEIagzdU2D7Gn7cI94MuxWirS0gh8bIdRQShBBEnbZW 9pzi5JU4+SFTyn6sRd7mffh4/a5ozIENvGW+vXjPzjoGbHaegASRPMKlqoXRmeQrG+hf F4BahIUYLunsoji6dmYd6KL9v/ZuTHKX8YD7h4KNv1pV4OMTHX1vepXtE3FZZ8UVY88A V3mQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20161025 header.b=W33yMJtF; 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 i188si5957267pgc.178.2018.03.23.06.35.03; Fri, 23 Mar 2018 06:35:11 -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=W33yMJtF; 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 9363A788E1; Fri, 23 Mar 2018 13:35:01 +0000 (UTC) X-Original-To: openembedded-core@lists.openembedded.org Delivered-To: openembedded-core@lists.openembedded.org Received: from mail-pl0-f68.google.com (mail-pl0-f68.google.com [209.85.160.68]) by mail.openembedded.org (Postfix) with ESMTP id E2A9C788BB for ; Fri, 23 Mar 2018 13:34:54 +0000 (UTC) Received: by mail-pl0-f68.google.com with SMTP id k22-v6so7423913pls.6 for ; Fri, 23 Mar 2018 06:34:56 -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:in-reply-to:references; bh=mvonfTM53GSPih2YKmpy/RAI0LONvFvk1MAkyUmy3wk=; b=W33yMJtFhXCpXa8rTfw1/rpdLbGkfmznzLd54CN2p4BRVeaYFDcPt6m2cbb8q80S/r ewthT5111fcUiBuD2rYjIoTzF/iva/ETZvu93EgoFmCjVj/GNC+adUFxIWoY/fJahhNm aX0InbElnbQA8eY3Br/W5dqG76agqf7tPkuvrEXeKKVZV0UEB2z969ak0tlZfiI+8a8Q y7OtEex+N4Ma4f+TtiNJWVk69+8QZuz7skVOLbBMvaHiGlOiLXNjNJ6OePchFlkvygwF jKCd1hItIZRNGoZrl74RvEra/pHl27/d3plGLlFG93cEvBY/wTRRMSTvkSqYbvfbj1ll uatQ== 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:in-reply-to :references; bh=mvonfTM53GSPih2YKmpy/RAI0LONvFvk1MAkyUmy3wk=; b=HuLdZFeeyBZFW6MI9VaSpbM5yBPn7t76ymEBKGb/rSKGRvp0C+uR2Heb2WvyHEKKqy M5wY9iC73YPOKfqrioGcSN/R66P+rpqMPAzvMHYp5eAPUca2kAo8nk/i1Qd5B4GXgkVn mf1ph867tk5XtioLyuFxDbp6Z9B6zpQ4g1OmVOn4DeFV+BcMHipTEtyj4bqPWOTXYzY8 O25UgmucwL98cP4B9qyDVJ9wE699fmd0j7/pCd+sHJ5ZjKxsthKMr3i41VD2KS0LCPIh KPgjWei140IVkVqvjNoPRJnO+VjRYJ4im81e+xZMsHAm7gjMqXZulY6CX/hkmxNCWC04 QH+Q== X-Gm-Message-State: AElRT7G8+xyHr3QMle+Dyc59HrVwU0MKXKSi7ZZNOOMjy0mGRBs79e61 1HaLgtIdCELWej/N0uZQc//GZg== X-Received: by 2002:a17:902:2d24:: with SMTP id o33-v6mr16258161plb.143.1521812096252; Fri, 23 Mar 2018 06:34:56 -0700 (PDT) Received: from localhost.localdomain ([2601:646:8880:466c:6245:cbff:fe64:591]) by smtp.gmail.com with ESMTPSA id q15sm18996375pfi.140.2018.03.23.06.34.54 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 23 Mar 2018 06:34:55 -0700 (PDT) From: Khem Raj To: openembedded-core@lists.openembedded.org Date: Fri, 23 Mar 2018 06:34:44 -0700 Message-Id: <20180323133445.15672-2-raj.khem@gmail.com> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180323133445.15672-1-raj.khem@gmail.com> References: <20180323133445.15672-1-raj.khem@gmail.com> Subject: [OE-core] [PATCH 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 --- ...ncpy-with-memccpy-to-fix-Wstringop-trunca.patch | 39 ++++++++++++++++++++++ meta/recipes-core/glibc/glibc_2.27.bb | 1 + 2 files changed, 40 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..d65a293748 --- /dev/null +++ b/meta/recipes-core/glibc/glibc/0029-Replace-strncpy-with-memccpy-to-fix-Wstringop-trunca.patch @@ -0,0 +1,39 @@ +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. +--- +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 ?= ""