You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
gentoo-overlay/app-text/msort/files/msort-8.53-fix-segfault-on-...

12 lines
384 B

--- 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);