From: Bruno Haible Date: Thu, 3 Jul 2025 13:47:02 +0000 (+0200) Subject: Modula-2 support: Fix possible crash during format string checking. X-Git-Tag: v0.26~29 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=0de73d2694b9cd50f38a9aae1708b632a7ca1e99;p=thirdparty%2Fgettext.git Modula-2 support: Fix possible crash during format string checking. * gettext-tools/src/format-modula2.c (format_check): Fix error message. Fix loop bound. --- diff --git a/gettext-tools/src/format-modula2.c b/gettext-tools/src/format-modula2.c index eb7418873..3f3ea4052 100644 --- a/gettext-tools/src/format-modula2.c +++ b/gettext-tools/src/format-modula2.c @@ -207,7 +207,7 @@ format_check (void *msgid_descr, void *msgstr_descr, bool equality, if (error_logger) error_logger (error_logger_data, _("a format specification for argument %zu doesn't exist in '%s'"), - n1 + 1, pretty_msgstr); + n2 + 1, pretty_msgstr); err = true; } else @@ -216,7 +216,7 @@ format_check (void *msgid_descr, void *msgstr_descr, bool equality, /* Check that the argument types are the same. */ if (!err) - for (i = 0; i < n1; i++) + for (i = 0; i < n2; i++) { if (spec1->args[i] != spec2->args[i]) {