summaryrefslogtreecommitdiff
path: root/debian/patches/intgen-avoid-overlapping-strcpy.patch
diff options
context:
space:
mode:
Diffstat (limited to 'debian/patches/intgen-avoid-overlapping-strcpy.patch')
-rw-r--r--debian/patches/intgen-avoid-overlapping-strcpy.patch17
1 files changed, 17 insertions, 0 deletions
diff --git a/debian/patches/intgen-avoid-overlapping-strcpy.patch b/debian/patches/intgen-avoid-overlapping-strcpy.patch
new file mode 100644
index 0000000..1aa53fd
--- /dev/null
+++ b/debian/patches/intgen-avoid-overlapping-strcpy.patch
@@ -0,0 +1,17 @@
+Description: intgen avoid overlapping strcpy
+ Lisp intgen is using overlapping strcpy which is not permitted,
+ switch to using memmove.
+Author: Andy Whitcroft <apw@ubuntu.com>
+Last-Update: 2013-04-22
+
+--- nyquist-3.05.orig/misc/intgen.c
++++ nyquist-3.05/misc/intgen.c
+@@ -487,7 +487,7 @@ static void process_file(fname, out)
+ /* strip off leading directory prefix, if any */
+ cp = strrchr(incl_file, FILESEP); /* find the last slash */
+ if (cp) {
+- strcpy(incl_file, cp + 1 /* skip the slash */);
++ memmove(incl_file, cp + 1 /* skip the slash */, strlen(cp + 1) + 1);
+ }
+
+ if (flag != no_include_prefix) fprintf(out, "#include \"%s\"\n\n", incl_file);