Glomm - 2015-05-12

Hi,

I found the error in the hypen.c file.
Function is hnj_hyphen_hyphword().

I can fix the Problem with the following check below. (if (hyphenslen < offset))
Please check this for you and check it in.

void hnj_hyphen_hyphword(const char * word, int l, const char * hyphens,
char * hyphword, char * rep, int pos, int ** cut)
{
int hyphenslen = l + 5;

int i, j;
for (i = 0, j = 0; i < l; i++, j++) {
if (hyphens[i]&1) {
hyphword[j] = word[i];
if (rep && pos && cut && (rep)[i]) {
size_t offset = j - (pos)[i] + 1;
if (hyphenslen < offset)
{
strncpy(hyphword + offset, (
rep)[i], hyphenslen - offset - 1);
hyphword[hyphenslen-1] = '\0';
j += strlen((rep)[i]) - (pos)[i];
i += (cut)[i] - (pos)[i];
}
} else hyphword[++j] = '=';
} else hyphword[j] = word[i];
}
hyphword[j] = '\0';
}

Thanks,

Gregor