gettext
ef37a154 - Avoid crash by stack overflow during plural expression evaluation.

Commit
1 year ago
Avoid crash by stack overflow during plural expression evaluation. * gettext-runtime/intl/plural-exp.h (enum eval_status, struct eval_result): New types. (plural_eval): Change return type to 'struct eval_result'. * gettext-runtime/intl/eval-plural.h (EVAL_MAXDEPTH, OK): New macros. (plural_eval_recurse): New function, extracted from plural_eval. (plural_eval): Change return type to 'struct eval_result'. Invoke plural_eval_recurse. * gettext-runtime/intl/dcigettext.c (plural_lookup): Update. * gettext-tools/src/plural-eval.h: Update comment. * gettext-tools/src/msgl-check.c (plural_expression_histogram): Update. (check_plural_eval): Update. Fail with an error message if the plural expression evaluation produced a stack overflow. * gettext-tools/tests/plural-3: Update.
Author
Committer
Parents
Loading