summaryrefslogtreecommitdiff
path: root/app-text/namazu/files/namazu-2.0.21-memmove.patch
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2018-07-14 21:03:06 +0100
committerV3n3RiX <venerix@redcorelinux.org>2018-07-14 21:03:06 +0100
commit8376ef56580626e9c0f796d5b85b53a0a1c7d5f5 (patch)
tree7681bbd4e8b05407772df40a4bf04cbbc8afc3fa /app-text/namazu/files/namazu-2.0.21-memmove.patch
parent30a9caf154332f12ca60756e1b75d2f0e3e1822d (diff)
gentoo resync : 14.07.2018
Diffstat (limited to 'app-text/namazu/files/namazu-2.0.21-memmove.patch')
-rw-r--r--app-text/namazu/files/namazu-2.0.21-memmove.patch56
1 files changed, 56 insertions, 0 deletions
diff --git a/app-text/namazu/files/namazu-2.0.21-memmove.patch b/app-text/namazu/files/namazu-2.0.21-memmove.patch
new file mode 100644
index 000000000000..30ad490e44fa
--- /dev/null
+++ b/app-text/namazu/files/namazu-2.0.21-memmove.patch
@@ -0,0 +1,56 @@
+--- a/nmz/search.c
++++ b/nmz/search.c
+@@ -572,7 +572,7 @@
+ {
+ if (*expr == '*' && expr[strlen(expr) - 1] != '*') {
+ /* If suffix match such as '*bar', enforce it into regex */
+- strcpy(expr, expr + 1);
++ memmove(expr, expr + 1, strlen(expr));
+ escape_meta_characters(expr, BUFSIZE * 2);
+ strncat(expr, "$", BUFSIZE * 2 - strlen(expr) - 1);
+ expr[BUFSIZE * 2 - 1] = '\0';
+@@ -584,7 +584,7 @@
+ expr[BUFSIZE * 2 - 1] = '\0';
+ } else if (*expr == '*' && expr[strlen(expr) - 1] == '*') {
+ /* If internal match such as '*foo*', enforce it into regex */
+- strcpy(expr, expr + 1);
++ memmove(expr, expr + 1, strlen(expr));
+ expr[strlen(expr) - 1] = '\0';
+ escape_meta_characters(expr, BUFSIZE * 2);
+ } else if (*expr == '/' && expr[strlen(expr) - 1] == '/') {
+@@ -592,7 +592,7 @@
+ nmz_debug_printf("do REGEX search\n");
+ /* Genuine regex */
+ /* Remove the both of '/' chars at begging and end of string */
+- strcpy(expr, expr + 1);
++ memmove(expr, expr + 1, strlen(expr));
+ expr[strlen(expr) - 1]= '\0';
+ } else {
+ nmz_debug_printf("disabled REGEX search\n");
+@@ -605,7 +605,7 @@
+ || (*expr == '{' && expr[strlen(expr) - 1] == '}'))
+ {
+ /* Delimiters of field search */
+- strcpy(expr, expr + 1);
++ memmove(expr, expr + 1, strlen(expr));
+ expr[strlen(expr) - 1] = '\0';
+ }
+ escape_meta_characters(expr, BUFSIZE * 2);
+@@ -695,7 +695,7 @@
+ delete_beginning_backslash(char *str)
+ {
+ if (*str == '\\') {
+- strcpy(str, str + 1);
++ memmove(str, str + 1, strlen(str));
+ }
+ }
+
+@@ -935,7 +935,7 @@
+ if ((strlen(str) >= 3 && (*str == '"' && str[strlen(str) - 1] == '"'))
+ || (*str == '{' && str[strlen(str) - 1] == '}'))
+ {
+- strcpy(str, str + 1);
++ memmove(str , str + 1, strlen(str));
+ str[strlen(str) - 1]= '\0';
+ }
+ }