<pre style='margin:0'>
Joshua Root (jmroot) pushed a commit to branch master
in repository macports-ports.
</pre>
<p><a href="https://github.com/macports/macports-ports/commit/5f57b2016ff9b894b179dd3b29cc1eb6f714096f">https://github.com/macports/macports-ports/commit/5f57b2016ff9b894b179dd3b29cc1eb6f714096f</a></p>
<pre style="white-space: pre; background: #F8F8F8">The following commit(s) were added to refs/heads/master by this push:
<span style='display:block; white-space:pre;color:#404040;'> new 5f57b2016ff ctags: fix undefined behaviour
</span>5f57b2016ff is described below
<span style='display:block; white-space:pre;color:#808000;'>commit 5f57b2016ff9b894b179dd3b29cc1eb6f714096f
</span>Author: Joshua Root <jmr@macports.org>
AuthorDate: Fri Jun 11 00:04:10 2021 +1000
<span style='display:block; white-space:pre;color:#404040;'> ctags: fix undefined behaviour
</span><span style='display:block; white-space:pre;color:#404040;'>
</span><span style='display:block; white-space:pre;color:#404040;'> Don't use strcpy on overlapping strings as its behaviour is undefined
</span><span style='display:block; white-space:pre;color:#404040;'> in that case. Remove previous workaround of using lower -O level.
</span><span style='display:block; white-space:pre;color:#404040;'>
</span><span style='display:block; white-space:pre;color:#404040;'> Closes: https://trac.macports.org/ticket/31256
</span>---
devel/ctags/Portfile | 15 +++------------
devel/ctags/files/strcpy_overlap.patch | 29 +++++++++++++++++++++++++++++
2 files changed, 32 insertions(+), 12 deletions(-)
<span style='display:block; white-space:pre;color:#808080;'>diff --git a/devel/ctags/Portfile b/devel/ctags/Portfile
</span><span style='display:block; white-space:pre;color:#808080;'>index 5abd711900b..6adb55ff70b 100644
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>--- a/devel/ctags/Portfile
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/devel/ctags/Portfile
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -4,7 +4,7 @@ PortSystem 1.0
</span>
name ctags
version 5.8
<span style='display:block; white-space:pre;background:#ffe0e0;'>-revision 3
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+revision 4
</span> checksums rmd160 191495869fbfa2f77a9619a4920eba26d02eface \
sha256 0e44b45dcabe969e0bbbb11e30c246f81abe5d32012db37395eb57d66e9e99c7 \
size 479927
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -44,20 +44,11 @@ master_sites sourceforge:project/${name}/${name}/${version}/
</span>
patchfiles patch-php.c.diff \
implicit.patch \
<span style='display:block; white-space:pre;background:#ffe0e0;'>- unused_namespace.patch
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ unused_namespace.patch \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ strcpy_overlap.patch
</span>
configure.args --enable-macro-patterns \
--mandir=\\\${prefix}/share/man \
--with-readlib
<span style='display:block; white-space:pre;background:#ffe0e0;'>-use_parallel_build yes
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span> destroot.destdir prefix=${destroot}${prefix}
<span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-# builds with llvm and -O2 but doesn't run correctly
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-# http://trac.macports.org/ticket/31256
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-if {[string match *clang* ${configure.compiler}] ||
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- [string match *dragonegg* ${configure.compiler}] ||
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- [string match *llvm* ${configure.compiler}]} {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- configure.optflags -O1
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-}
</span><span style='display:block; white-space:pre;color:#808080;'>diff --git a/devel/ctags/files/strcpy_overlap.patch b/devel/ctags/files/strcpy_overlap.patch
</span>new file mode 100644
<span style='display:block; white-space:pre;color:#808080;'>index 00000000000..b06bd0da5b4
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>--- /dev/null
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/devel/ctags/files/strcpy_overlap.patch
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -0,0 +1,29 @@
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+--- argproc.c.orig 2006-10-12 13:26:40.000000000 +1000
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++++ argproc.c 2021-06-10 23:30:15.000000000 +1000
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -309,7 +309,7 @@ $DESCRIPTOR (resultspec, "");
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if (!had_path) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ char *s = strrchr (string, ']');
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if ( s == NULL ) s = strrchr (string, ':');
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if ( s != NULL ) strcpy (string, s+1);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if ( s != NULL ) memmove (string, s+1, strlen(s+1)+1);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ /*
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ * Be consistent with what the C RTL has already done to the rest of
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+--- routines.c.orig 2007-06-07 14:35:21.000000000 +1000
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++++ routines.c 2021-06-10 23:37:45.000000000 +1000
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -757,13 +757,13 @@ extern char* absoluteFilename (const cha
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ else if (cp [0] != PATH_SEPARATOR)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ cp = slashp;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- strcpy (cp, slashp + 3);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ memmove (cp, slashp + 3, strlen(slashp + 3)+1);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ slashp = cp;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ continue;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ else if (slashp [2] == PATH_SEPARATOR || slashp [2] == '\0')
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- strcpy (slashp, slashp + 2);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ memmove (slashp, slashp + 2, strlen(slashp + 2)+1);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ continue;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span></pre><pre style='margin:0'>
</pre>