diff options
author | CoprDistGit <infra@openeuler.org> | 2024-08-06 04:42:21 +0000 |
---|---|---|
committer | CoprDistGit <infra@openeuler.org> | 2024-08-06 04:42:21 +0000 |
commit | 90e2665fab71dcfbf5451b8d371429dd3638b5e3 (patch) | |
tree | 4dc63221d5727640917fd5e1d92afef4e15526c1 /autogen-gcc9-fix-wrestrict.patch | |
parent | 98578c46dbdc3a1434790e8fb6e5bdf5da1eb9bd (diff) |
automatic import of autogenopeneuler24.03_LTS
Diffstat (limited to 'autogen-gcc9-fix-wrestrict.patch')
-rw-r--r-- | autogen-gcc9-fix-wrestrict.patch | 56 |
1 files changed, 56 insertions, 0 deletions
diff --git a/autogen-gcc9-fix-wrestrict.patch b/autogen-gcc9-fix-wrestrict.patch new file mode 100644 index 0000000..09220e8 --- /dev/null +++ b/autogen-gcc9-fix-wrestrict.patch @@ -0,0 +1,56 @@ +Origin: https://build.opensuse.org/package/show/openSUSE:Factory/autogen +Author: Martin Liška <mliska@suse.cz> +Bug-Suse: https://bugzilla.suse.com/show_bug.cgi?id=1125772 +Forwarded: https://sourceforge.net/p/autogen/bugs/193/ +Comment: Superseded by 132576313e66ee270ebb70f82afdaeacec1f2fc1 + +diff --git a/compat/pathfind.c b/compat/pathfind.c +index 5c477ca..6a4eeb5 100644 +--- a/compat/pathfind.c ++++ b/compat/pathfind.c +@@ -136,6 +136,18 @@ make_absolute( char const * string, char const * dot_path ) + return result; + } + ++/* ++ * Proccess strcpy for overlapping memory locations. ++ */ ++static char* ++strcpy_overlapping ( char *d, const char *s) ++{ ++ unsigned n = strlen ( s ); ++ memmove ( d, s, n + 1 ); ++ return d; ++} ++ ++ + /* + * Canonicalize PATH, and return a new path. The new path differs from + * PATH in that: +@@ -182,7 +194,7 @@ canonicalize_pathname( char *path ) + if ((start + 1) != i && (start != 0 || i != 2)) + #endif /* apollo */ + { +- strcpy( result + start + 1, result + i ); ++ strcpy_overlapping( result + start + 1, result + i ); + i = start + 1; + } + +@@ -201,7 +213,7 @@ canonicalize_pathname( char *path ) + if (result[i] == '.') { + /* Handle `./'. */ + if (result[i + 1] == '/') { +- strcpy( result + i, result + i + 1 ); ++ strcpy_overlapping( result + i, result + i + 1 ); + i = (start < 0) ? 0 : start; + continue; + } +@@ -211,7 +223,7 @@ canonicalize_pathname( char *path ) + (result[i + 2] == '/' || !result[i + 2])) { + while (--start > -1 && result[start] != '/') + ; +- strcpy( result + start + 1, result + i + 2 ); ++ strcpy_overlapping( result + start + 1, result + i + 2 ); + i = (start < 0) ? 0 : start; + continue; + } |