Skip to content

possible bug in hyphen.c, when using Turkish dictionary #20

@aloistr

Description

@aloistr

in hyphen.c line 869 offset = i + 1 - strlen (match);
I arrive with offset = -1;
This damages the alloc memory in line 888: matchrepl[offset + k] = repl;
because it writes to matchrepl[-1]
That leads later to a crash when free() is called.
I have fixed the problem by adding line 870: if (offset < 0) offset = 0;
but I am nor sure this is save.

The problem appears when I use a Turkish dictionary, and the error may caused by bad data in
the dictionary hyph_tr.dic from
https://github.com/Slyneth/hunspell-hyphenation-turkish

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions