summaryrefslogtreecommitdiff
path: root/app-text/msort/files/msort-8.53-fix-segfault-on-certain-input.patch
diff options
context:
space:
mode:
Diffstat (limited to 'app-text/msort/files/msort-8.53-fix-segfault-on-certain-input.patch')
-rw-r--r--app-text/msort/files/msort-8.53-fix-segfault-on-certain-input.patch11
1 files changed, 11 insertions, 0 deletions
diff --git a/app-text/msort/files/msort-8.53-fix-segfault-on-certain-input.patch b/app-text/msort/files/msort-8.53-fix-segfault-on-certain-input.patch
new file mode 100644
index 000000000000..01edc69eb7da
--- /dev/null
+++ b/app-text/msort/files/msort-8.53-fix-segfault-on-certain-input.patch
@@ -0,0 +1,11 @@
+--- a/dstr.c 2009-08-05 05:09:21.000000000 +0200
++++ b/dstr.c 2018-09-27 15:43:52.815761856 +0200
+@@ -79,7 +79,7 @@
+ #ifdef SAFECALL
+ if(length == 0) return(ERROR);
+ #endif
+- if (length > tgt->c) {
++ if (length + 1 > tgt->c) {
+ if(tgt->s != NULL) free( (void *) tgt->s);
+ tgt->s = (wchar_t *) malloc((length + 1) * sizeof(wchar_t));
+ if(tgt->s == NULL) return(ERROR);