aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorDave Vandervies2015-03-08 14:03:02 -0400
committerJack Nagel2015-03-22 12:24:35 -0400
commit81025f04df6720298888e0bbbb7351d2dde4f531 (patch)
treea9218a7e0490c2b921edb529cf32612958f6a0df /Library
parent9ec7a75c92033a0ed1fd21b3374f1e013e27cc5d (diff)
downloadhomebrew-81025f04df6720298888e0bbbb7351d2dde4f531.tar.bz2
ctags: don't strcpy overlapping buffers
Upstream committed this patch in 2012, but it hasn't made it into a release yet (last release was in 2009). Using --tag-relative, with relative paths to both the output tagfile and the files to tag, with sufficiently long pathnames, produces bad filenames in the output tagfile. Closes #37521. Signed-off-by: Jack Nagel <jacknagel@gmail.com>
Diffstat (limited to 'Library')
-rw-r--r--Library/Formula/ctags.rb24
1 files changed, 24 insertions, 0 deletions
diff --git a/Library/Formula/ctags.rb b/Library/Formula/ctags.rb
index b502e4299..c07e7595e 100644
--- a/Library/Formula/ctags.rb
+++ b/Library/Formula/ctags.rb
@@ -2,6 +2,7 @@ class Ctags < Formula
homepage "http://ctags.sourceforge.net/"
url "https://downloads.sourceforge.net/ctags/ctags-5.8.tar.gz"
sha1 "482da1ecd182ab39bbdc09f2f02c9fba8cd20030"
+ revision 1
bottle do
cellar :any
@@ -102,3 +103,26 @@ diff -ur a/ctags-5.8/read.h b/ctags-5.8/read.h
/*
* FUNCTION PROTOTYPES
+
+
+Bugfix: Don't use strcpy on overlapping buffers
+Upstream commit (not in release yet): http://sourceforge.net/p/ctags/code/782/
+diff -ur a/ctags-5.8/routines.c b/ctags-5.8/routines.c
+--- a/ctags-5.8/routines.c 2007-06-07 00:35:21.000000000 -0400
++++ b/ctags-5.8/routines.c 2015-03-07 20:38:58.000000000 -0500
+@@ -757,13 +757,13 @@
+ else if (cp [0] != PATH_SEPARATOR)
+ cp = slashp;
+ #endif
+- strcpy (cp, slashp + 3);
++ memmove (cp, slashp + 3, strlen (slashp + 3) + 1);
+ slashp = cp;
+ continue;
+ }
+ else if (slashp [2] == PATH_SEPARATOR || slashp [2] == '\0')
+ {
+- strcpy (slashp, slashp + 2);
++ memmove (slashp, slashp + 2, strlen (slashp + 2) + 1);
+ continue;
+ }
+ }