Description: fix for segfault on certain input
Author: Margarita Manterola <margamanterola.bugs@gmail.com>
Bug-Debian: http://bugs.debian.org/630485
Origin: other

--- msort-8.53.orig/dstr.c
+++ msort-8.53/dstr.c
@@ -79,7 +79,7 @@ FillDynamicString(struct dstr *tgt, wcha
 #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);
