diff --git a/edit/ChangeLog b/edit/ChangeLog index ec315d8c4..3438689af 100644 --- a/edit/ChangeLog +++ b/edit/ChangeLog @@ -1,3 +1,8 @@ +2003-12-24 Dmitry Alexeyev + + * syntax.c (edit_read_syntax_rules): Fix crash if syntax file + has more than 1024 keywords. + 2003-11-27 Pavel Roskin * editcmd.c: Use input_expand_dialog() instead of input_dialog() diff --git a/edit/syntax.c b/edit/syntax.c index d8db3a24a..b64c2f534 100644 --- a/edit/syntax.c +++ b/edit/syntax.c @@ -800,6 +800,8 @@ edit_read_syntax_rules (WEdit *edit, FILE *f, char **args) struct key_word *k; if (num_words == -1) break_a; + if (num_words >= MAX_WORDS_PER_CONTEXT) + break; check_a; k = r[num_contexts - 1]->keyword[num_words] = g_malloc0 (sizeof (struct key_word)); if (!strcmp (*a, "whole")) {