Logged In: NO

I have the same problem and found the bug in the source code.

Here is my diff -u of the patch:

===================================================================
RCS file: /home/u1/plscvs/extsource/diffh/src/chunk.c,v
retrieving revision 1.1.1.1
diff -u -r1.1.1.1 chunk.c
--- chunk.c 2007/09/20 17:32:43 1.1.1.1
+++ chunk.c 2007/10/26 08:32:22
@@ -163,7 +163,7 @@
newword = malloc((oldj-currentword+1) *sizeof(char));
strncpy(newword, currentword, oldj - currentword);
newword[oldj-currentword] = '\0';
- if (currentwordidx >= word_malloc_size)
+ while (currentwordidx >= word_malloc_size)
ch->word = realloc(ch->word,
(word_malloc_size*=2) * sizeof(char*));
ch->word[currentwordidx++] = newword;
@@ -184,7 +184,7 @@
newword = malloc((j - currentword + 1) * sizeof(char));
strncpy(newword, currentword, j - currentword);
newword[j-currentword] = '\0';
- if (currentwordidx >= word_malloc_size)
+ while (currentwordidx >= word_malloc_size)
ch->word = realloc(ch->word,
(word_malloc_size*=2) * sizeof(char*));
ch->word[currentwordidx++] = newword;
@@ -193,7 +193,7 @@
{
newword = malloc(sizeof(char));
*newword = '\0';
- if (currentwordidx >= word_malloc_size)
+ while (currentwordidx >= word_malloc_size)
ch->word = realloc(ch->word, (word_malloc_size*=2)
* sizeof(char*));
ch->word[currentwordidx++] = newword;
@@ -458,7 +458,7 @@
if (highlight_on)
{
thislinelen_new += strlen(HIGHLIGHT_OFF);
- if (thislinelen_new+1 >= thisline_malloc_size)
+ while (thislinelen_new+1 >= thisline_malloc_size)
thisline = realloc(thisline, (thisline_malloc_size*=2)
* sizeof(char));
strcpy(thisline+thislinelen, HIGHLIGHT_OFF);
@@ -531,7 +531,7 @@
/* Expand thisline if necessary */
if (highlight_text) thislinelen_new += strlen(highlight_text);
thislinelen_new += strlen(thisword);
- if (thislinelen_new+1 >= thisline_malloc_size)
+ while (thislinelen_new+1 >= thisline_malloc_size)
thisline = realloc(thisline, (thisline_malloc_size*=2)
* sizeof(char));
if (highlight_text)
@@ -548,7 +548,7 @@
if (highlight_on)
{
thislinelen_new += strlen(HIGHLIGHT_OFF);
- if (thislinelen_new+1 >= thisline_malloc_size)
+ while (thislinelen_new+1 >= thisline_malloc_size)
thisline = realloc(thisline, (thisline_malloc_size*=2)
* sizeof(char));
strcpy(thisline+thislinelen, HIGHLIGHT_OFF);

I looked for all realloc() calls. I have replaced all if (... >= ...) with while (... >= ...) so the buffer will be expanded until it has enough space to insert the expanded string.