f6207843e5
Add bash-memmove.patch to make bash.html build reproducible (boo#1100488) OBS-URL: https://build.opensuse.org/request/show/621385 OBS-URL: https://build.opensuse.org/package/show/Base:System/bash?expand=0&rev=266
20 lines
614 B
Diff
20 lines
614 B
Diff
Author: Bernhard M. Wiedemann <bwiedemann suse de>
|
|
Date: 2018-07-07
|
|
|
|
strcpy can cause corruption when working on overlapping strings
|
|
so we use memmove instead that handles this case correctly
|
|
|
|
Index: bash-4.4/support/man2html.c
|
|
===================================================================
|
|
--- bash-4.4.orig/support/man2html.c
|
|
+++ bash-4.4/support/man2html.c
|
|
@@ -1992,7 +1993,7 @@ unescape (char *c)
|
|
while (i < l && c[i]) {
|
|
if (c[i] == '\a') {
|
|
if (c[i+1])
|
|
- strcpy(c + i, c + i + 1); /* should be memmove */
|
|
+ memmove(c + i, c + i + 1, strlen(c + i));
|
|
else {
|
|
c[i] = '\0';
|
|
break;
|