]> git.netwichtig.de Git - user/henk/code/exim.git/blobdiff - src/src/macro.c
Update copyright year to 2018
[user/henk/code/exim.git] / src / src / macro.c
index 82c1ec717bf511cfebf6c7c3c7a8ece83fd4b1ec..21e51044ea93ac1fb5dfcbd3d92cc0c786c7b168 100644 (file)
@@ -2,7 +2,7 @@
 *     Exim - an Internet mail transport agent    *
 *************************************************/
 
-/* Copyright (c) University of Cambridge 1995 - 2017 */
+/* Copyright (c) University of Cambridge 1995 - 2018 */
 /* See the file NOTICE for conditions of use and distribution. */
 
 /* Functions for handling macros */
@@ -40,7 +40,11 @@ m->namelen = namelen;
 m->replen = Ustrlen(val);
 m->m_number = m_number++;
 memset(&m->tnode, 0, sizeof(tree_node));
-Ustrcpy(m->tnode.name, name);
+/* Use memcpy here not Ustrcpy to avoid spurious compiler-inserted check
+when building with fortify-source. We know there is room for the copy into
+this dummy for a variable-size array because of the way we did the memory
+allocation above. */
+memcpy(m->tnode.name, name, namelen+1);
 m->tnode.data.ptr = string_copyn(val, m->replen);
 (void) tree_insertnode(&tree_macros, &m->tnode);