Debian Codegraph @

debian/patches/segfault

raw
1 Description: fix for segfault on certain input
2 Author: Margarita Manterola <[email protected]>
3 Bug-Debian: http://bugs.debian.org/630485
4 Origin: other
5
6 --- msort-8.53.orig/dstr.c
7 +++ msort-8.53/dstr.c
8 @@ -79,7 +79,7 @@ FillDynamicString(struct dstr *tgt, wcha
9 #ifdef SAFECALL
10 if(length == 0) return(ERROR);
11 #endif
12 - if (length > tgt->c) {
13 + if (length + 1 > tgt->c) {
14 if(tgt->s != NULL) free( (void *) tgt->s);
15 tgt->s = (wchar_t *) malloc((length + 1) * sizeof(wchar_t));
16 if(tgt->s == NULL) return(ERROR);