• R
    harden dcngettext plural processing · e4dd0ab8
    Rich Felker 提交于
    while the __mo_lookup backend can verify that the translated message
    ends with a null terminator, is has no way to know nplurals and thus
    no way to verify that sufficiently many null terminators are present
    in the string to satisfy all plural forms. the code in dcngettext was
    already attempting to avoid reading past the end of the mo file
    mapping, but failed to do so because the strlen call itself could
    over-read. using strnlen instead allows us to avoid the problem.
    e4dd0ab8
dcngettext.c 5.5 KB