Hi,
I using the current hunspell86.dll Version 1.2.554.16953 from nuget with NHunspell .Net wrapper.
Internal we are calling the function:
MarshalHunspellDll.HyphenHyphenate(this.unmanagedHandle, word);
Now we have a string in hungarian that cases a Crash / Segmentation fault.
Examples:
"Vákuumszivattyú: száma szivattyú"
or
"Vákuumszivattyú: túllépte a bekapcsolások óránkénti maximális számát. A bekapcsolások számának túllépése a szivattyú károsodását okozza."
Please fix this bug.
Thanks,
Gregor
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