Bug ID | 1227316 |
---|---|
Summary | gettext-runtime: msgcat fails on certain files |
Classification | openSUSE |
Product | openSUSE Distribution |
Version | Leap 15.6 |
Hardware | Other |
OS | Other |
Status | CONFIRMED |
Severity | Normal |
Priority | P5 - None |
Component | Basesystem |
Assignee | sbrabec@suse.com |
Reporter | sbrabec@suse.com |
QA Contact | qa-bugs@suse.de |
CC | christian.voegl@suse.com, mmachova@suse.com |
Target Milestone | --- |
Found By | --- |
Blocker | --- |
While trying to concatenate two po files, I got: msgcat: memory exhausted Debugging in gdb, I realized that one of the failing po files has a non standard header that contains extra empty line: msgid "" msgstr "" "Project-Id-Version: @PACKAGE@\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2021-09-16 17:13+0200\n" "PO-Revision-Date: 2005-07-29 15:37+0530\n" "Last-Translator: Priyavert Sharma<priyavert.sharma@agreeya.com>\n" "Language-Team: AgreeYa Solutions <linux_team@agreeya.com>\n" "Language: \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n!=1);\n" "\n" The bug is triggered in msgl-header.c: message_list_header_list() while (*h != '\0') { char *enh = strchr (h, ':'); enh++; char * msgid = (char *)XNMALLOC (((enh - h) + 1), char); If the line does not contain ":", then enh is zero, and (enh - h) + 1 is evaluated to an absurd number. This is not an upstream bug. The smart header merge feature is introduced by: 0002-msgcat-Merge-headers-when-use-first.patch