gettext
726bfb1d - Avoid crash by SIGFPE during plural form expression evaluation.

Commit
1 year ago
Avoid crash by SIGFPE during plural form expression evaluation. Libraries (such as libintl and libgettextpo) should not raise signals, because catching such signals cannot be done in a multithread-safe way. * gettext-runtime/intl/plural-exp.h (enum eval_status): New enum items PE_INTDIV, PE_INTOVF. * gettext-runtime/intl/eval-plural.h (plural_eval_recurse): When a division argument is zero, return status PE_INTDIV instead of raising SIGFPE. * gettext-runtime/intl/dcigettext.c (INTDIV0_RAISES_SIGFPE): Remove macro. Don't include <signal.h>. * gettext-runtime/intl/configure.ac: Don't invoke gt_INTDIV0. * gettext-runtime/intl/m4/intdiv0.m4: Remove file. * gettext-runtime/intl/Makefile.am (ACLOCAL_AMFLAGS): Remove option '-I m4'. (EXTRA_DIST): Remove m4/intdiv0.m4. * autogen.sh: When invoking aclocal in gettext-runtime/intl, omit option '-I m4'. * gettext-tools/src/msgl-check.c: Don't include <setjmp.h>, <signal.h>. (plural_expression_histogram): Don't invoke install_sigfpe_handler, uninstall_sigfpe_handler. (check_plural_eval): Don't invoke setjmp, install_sigfpe_handler, uninstall_sigfpe_handler. Remove 'volatile' from array variable. Produce error message when status PE_INTDIV or PE_INTOVF occurred. * gettext-tools/src/plural-eval.h: Don't include <setjmp.h>. (sigjmp_buf, sigsetjmp, siglongjmp): Remove definitions. (USE_SIGINFO): Remove macro. (sigfpe_exit, sigfpe_code, install_sigfpe_handler, uninstall_sigfpe_handler): Remove declarations. * gettext-tools/src/plural-eval.c: Don't include <signal.h>. (sigfpe_exit, sigfpe_code): Remove variables. (sigfpe_handler, install_sigfpe_handler, uninstall_sigfpe_handler): Remove functions. * gettext-tools/configure.ac: Don't invoke gt_SIGINFO. * gettext-tools/m4/siginfo.m4: Remove file. * gettext-tools/m4/Makefile.am (EXTRA_DIST): Remove it.
Author
Committer
Parents
Loading