[oe-commits] [openembedded-core] 13/22: glibc: Replace strncpy with memccpy to fix -Wstringop-truncation.

git at git.openembedded.org git at git.openembedded.org
Wed Mar 28 11:47:43 UTC 2018


This is an automated email from the git hooks/post-receive script.

rpurdie pushed a commit to branch master
in repository openembedded-core.

commit 1c8887ec629516333cbe3736bc0f9d24fb08dffe
Author: Khem Raj <raj.khem at gmail.com>
AuthorDate: Fri Mar 23 13:48:23 2018 -0700

    glibc: Replace strncpy with memccpy to fix -Wstringop-truncation.
    
    Signed-off-by: Khem Raj <raj.khem at gmail.com>
    Signed-off-by: Ross Burton <ross.burton at intel.com>
---
 ...ncpy-with-memccpy-to-fix-Wstringop-trunca.patch | 40 ++++++++++++++++++++++
 meta/recipes-core/glibc/glibc_2.27.bb              |  1 +
 2 files changed, 41 insertions(+)

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 0000000..fa29f41
--- /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 <raj.khem at gmail.com>
+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 <raj.khem at gmail.com>
+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 4f6f58c..4a461ab 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 ?= ""

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Openembedded-commits mailing list