summaryrefslogtreecommitdiff
path: root/packages/glibc/2.14.1/0048-zic.c-use-memcpy.patch
diff options
context:
space:
mode:
Diffstat (limited to 'packages/glibc/2.14.1/0048-zic.c-use-memcpy.patch')
-rw-r--r--packages/glibc/2.14.1/0048-zic.c-use-memcpy.patch25
1 files changed, 25 insertions, 0 deletions
diff --git a/packages/glibc/2.14.1/0048-zic.c-use-memcpy.patch b/packages/glibc/2.14.1/0048-zic.c-use-memcpy.patch
new file mode 100644
index 0000000..4c89446
--- /dev/null
+++ b/packages/glibc/2.14.1/0048-zic.c-use-memcpy.patch
@@ -0,0 +1,25 @@
+commit e69897bf202e18034cbef26f363bae64de70a196
+Author: Paul Eggert <eggert@cs.ucla.edu>
+Date: Sun Nov 12 22:00:28 2017 -0800
+
+ timezone: pacify GCC -Wstringop-truncation
+
+ Problem reported by Martin Sebor in:
+ https://sourceware.org/ml/libc-alpha/2017-11/msg00336.html
+ * timezone/zic.c (writezone): Use memcpy, not strncpy.
+
+---
+ timezone/zic.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/timezone/zic.c
++++ b/timezone/zic.c
+@@ -1648,7 +1648,7 @@
+ #define DO(field) (void) fwrite((void *) tzh.field, \
+ (size_t) sizeof tzh.field, (size_t) 1, fp)
+ tzh = tzh0;
+- (void) strncpy(tzh.tzh_magic, TZ_MAGIC, sizeof tzh.tzh_magic);
++ memcpy(tzh.tzh_magic, TZ_MAGIC, sizeof tzh.tzh_magic);
+ tzh.tzh_version[0] = ZIC_VERSION;
+ convert(eitol(thistypecnt), tzh.tzh_ttisgmtcnt);
+ convert(eitol(thistypecnt), tzh.tzh_ttisstdcnt);