diff options
-rw-r--r-- | debian/patches/intgen-avoid-overlapping-strcpy.patch | 17 | ||||
-rw-r--r-- | debian/patches/series | 1 | ||||
-rw-r--r-- | misc/intgen.c | 2 |
3 files changed, 19 insertions, 1 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); diff --git a/debian/patches/series b/debian/patches/series index 924a4ee..4beb433 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -4,3 +4,4 @@ use-system-sndfile.patch use-system-liblo.patch use-system-portadio.patch fix-term-includes.patch +intgen-avoid-overlapping-strcpy.patch diff --git a/misc/intgen.c b/misc/intgen.c index d9228a7..c42127c 100644 --- a/misc/intgen.c +++ b/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); |