From 433c980806446dd55eb694f9336260ac6db667e4 Mon Sep 17 00:00:00 2001 From: Than Ngo Date: Tue, 18 Jun 2013 11:44:29 +0200 Subject: [PATCH] bug #284 absoluteFilename uses strcpy on overlapping strings --- ctags-5.8-memmove.patch | 19 +++++++++++++++++++ ctags.spec | 12 +++++++++++- 2 files changed, 30 insertions(+), 1 deletion(-) create mode 100644 ctags-5.8-memmove.patch diff --git a/ctags-5.8-memmove.patch b/ctags-5.8-memmove.patch new file mode 100644 index 0000000..5608f04 --- /dev/null +++ b/ctags-5.8-memmove.patch @@ -0,0 +1,19 @@ +diff -r -u ctags-5.8.orig/routines.c ctags-5.8/routines.c +--- ctags-5.8.orig/routines.c 2013-06-13 10:42:08.048576327 -0400 ++++ ctags-5.8/routines.c 2013-06-13 10:48:25.150366836 -0400 +@@ -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; + } + } diff --git a/ctags.spec b/ctags.spec index 50fbfbd..d0f618e 100644 --- a/ctags.spec +++ b/ctags.spec @@ -1,7 +1,7 @@ Summary: A C programming language indexing and/or cross-reference tool Name: ctags Version: 5.8 -Release: 10%{?dist} +Release: 11%{?dist} License: GPLv2+ and LGPLv2+ and Public Domain Group: Development/Tools URL: http://ctags.sourceforge.net/ @@ -11,6 +11,7 @@ Patch1: ctags-5.7-segment-fault.patch Patch2: ctags-5.8-css.patch Patch3: ctags-5.8-ocaml-crash.patch Patch4: ctags-5.8-cssparse.patch +Patch5: ctags-5.8-memmove.patch Buildroot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) %description @@ -49,6 +50,7 @@ Note: some command line options is not compatible with GNU etags. %patch2 -p1 -b .css-support %patch3 -p1 -b .ocaml-crash %patch4 -p1 -b .cssparse-crash +%patch5 -p1 -b .memmove %build %configure @@ -91,6 +93,14 @@ rm -rf %{buildroot} %{_mandir}/man1/etags.%{name}.1* %changelog +* Thu Jun 13 2013 John Dennis - 5.8-11 +- add ctags-5.8-memmove.patch + bug #284 absoluteFilename uses strcpy on overlapping strings + http://sourceforge.net/p/ctags/bugs/284/ + The bug was fixed upstream on 2012-03-26 in the following commit + http://sourceforge.net/p/ctags/code/782/ + ctags-5.8-memmove.patch simply adds the same patch as the above commit. + * Wed Feb 13 2013 Fedora Release Engineering - 5.8-10 - Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild