Compare commits
2 Commits
Author | SHA256 | Date | |
---|---|---|---|
d11f81b6f2 | |||
9efda21c11 |
@@ -1,98 +0,0 @@
|
|||||||
From 88d67f8eacdd301d836a6902374dc10e8cc05d57 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Stanislav Brabec <sbrabec@suse.com>
|
|
||||||
Date: Wed, 26 Feb 2025 03:00:18 +0100
|
|
||||||
Subject: [PATCH 3/3] Fix malformed header processing
|
|
||||||
|
|
||||||
---
|
|
||||||
gettext-tools/src/msgl-header.c | 68 ++++++++++++++++++++++++---------
|
|
||||||
1 file changed, 51 insertions(+), 17 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/gettext-tools/src/msgl-header.c b/gettext-tools/src/msgl-header.c
|
|
||||||
index 6fe659e73..fb5186a89 100644
|
|
||||||
--- a/gettext-tools/src/msgl-header.c
|
|
||||||
+++ b/gettext-tools/src/msgl-header.c
|
|
||||||
@@ -397,30 +397,64 @@ message_list_header_list (message_list_ty *mlp)
|
|
||||||
{
|
|
||||||
/* We found the correct message. */
|
|
||||||
message_ty *mp = mlp->item[j];
|
|
||||||
+
|
|
||||||
+ /* Test whether the field occurs in the header entry. */
|
|
||||||
const char *h = mp->msgstr;
|
|
||||||
+
|
|
||||||
message_list_ty * header = message_list_alloc (false);
|
|
||||||
int ctr = 0;
|
|
||||||
|
|
||||||
while (*h != '\0')
|
|
||||||
- {
|
|
||||||
- char *enh = strchr (h, ':');
|
|
||||||
- enh++;
|
|
||||||
- char * msgid = (char *)XNMALLOC (((enh - h) + 1), char);
|
|
||||||
- memcpy (msgid, h, enh - h);
|
|
||||||
- /* Make the string null-terminated. */
|
|
||||||
- (msgid)[enh-h] = '\0';
|
|
||||||
- h = enh + 1;
|
|
||||||
-
|
|
||||||
- enh = strchr (h, '\n');
|
|
||||||
- if (enh != NULL)
|
|
||||||
+ {
|
|
||||||
+ const char *enh;
|
|
||||||
+ const char *enhz;
|
|
||||||
+ const char *sep;
|
|
||||||
+ const char *value;
|
|
||||||
+
|
|
||||||
+ enh = strchr (h, '\n');
|
|
||||||
+ if (enh)
|
|
||||||
+ {
|
|
||||||
+ enhz = enh;
|
|
||||||
+ enh++;
|
|
||||||
+ }
|
|
||||||
+ else
|
|
||||||
+ {
|
|
||||||
+ /* Missing trailing EOL. */
|
|
||||||
+ enh = h + strlen(h);
|
|
||||||
+ enhz = enh;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ sep = strchr (h, ':');
|
|
||||||
+ if (sep == NULL || sep >= enhz)
|
|
||||||
+ {
|
|
||||||
+ /* Line does not contain ':'. */
|
|
||||||
+ sep = enhz;
|
|
||||||
+ value = enhz;
|
|
||||||
+ }
|
|
||||||
+ else
|
|
||||||
+ {
|
|
||||||
+ sep++;
|
|
||||||
+ if (*sep != ' ')
|
|
||||||
+ /* ' ' missing after ':'. */
|
|
||||||
+ value = sep;
|
|
||||||
+ else
|
|
||||||
+ value = sep + 1;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ char * msgid = (char *)XNMALLOC (((sep - h) + 1), char);
|
|
||||||
+ memcpy (msgid, h, sep - h);
|
|
||||||
+ /* Make the string null-terminated. */
|
|
||||||
+ msgid[sep-h] = '\0';
|
|
||||||
+ char * msgstr = (char *)XNMALLOC (((enhz - value) + 1), char);
|
|
||||||
+ memcpy (msgstr, value, enhz - value);
|
|
||||||
+ /* Make the string null-terminated. */
|
|
||||||
+ msgstr[enhz-value] = '\0';
|
|
||||||
+
|
|
||||||
+ if (h != NULL)
|
|
||||||
{
|
|
||||||
- char * msgstr = (char *)XNMALLOC (((enh - h) + 1), char);
|
|
||||||
- memcpy (msgstr, h, enh - h);
|
|
||||||
- /* Make the string null-terminated. */
|
|
||||||
- msgstr[enh-h] = '\0';
|
|
||||||
lex_pos_ty pos = {NULL, ctr++};
|
|
||||||
- message_list_append (header, message_alloc (NULL, msgid, NULL, msgstr, enh - h, &pos));
|
|
||||||
- h = enh + 1;
|
|
||||||
+ message_list_append (header, message_alloc (NULL, msgid, NULL, msgstr, enhz - value, &pos));
|
|
||||||
+ h = enh;
|
|
||||||
}
|
|
||||||
else return NULL;
|
|
||||||
}
|
|
||||||
--
|
|
||||||
2.48.1
|
|
||||||
|
|
@@ -1,10 +1,3 @@
|
|||||||
-------------------------------------------------------------------
|
|
||||||
Wed Feb 26 03:01:34 CET 2025 - Stanislav Brabec <sbrabec@suse.com>
|
|
||||||
|
|
||||||
- Fix crash while handling po files with malformed header and
|
|
||||||
process them properly
|
|
||||||
(0003-Fix-malformed-header-processing.patch, boo#1227316).
|
|
||||||
|
|
||||||
-------------------------------------------------------------------
|
-------------------------------------------------------------------
|
||||||
Tue Jul 16 08:42:20 UTC 2024 - Bernhard Wiedemann <bwiedemann@suse.com>
|
Tue Jul 16 08:42:20 UTC 2024 - Bernhard Wiedemann <bwiedemann@suse.com>
|
||||||
|
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
#
|
#
|
||||||
# spec file for package gettext-csharp
|
# spec file for package gettext-csharp
|
||||||
#
|
#
|
||||||
# Copyright (c) 2025 SUSE LLC
|
# Copyright (c) 2024 SUSE LLC
|
||||||
#
|
#
|
||||||
# All modifications and additions to the file contributed by third parties
|
# All modifications and additions to the file contributed by third parties
|
||||||
# remain the property of their copyright owners, unless otherwise agreed
|
# remain the property of their copyright owners, unless otherwise agreed
|
||||||
@@ -47,8 +47,6 @@ Patch13: reproducible.patch
|
|||||||
# PATCH-FEATURE bsc#1165138
|
# PATCH-FEATURE bsc#1165138
|
||||||
Patch14: 0001-msgcat-Add-feature-to-use-the-newest-po-file.patch
|
Patch14: 0001-msgcat-Add-feature-to-use-the-newest-po-file.patch
|
||||||
Patch15: 0002-msgcat-Merge-headers-when-use-first.patch
|
Patch15: 0002-msgcat-Merge-headers-when-use-first.patch
|
||||||
# PATCH-FEATURE-FIX-SUSE boo#1227316 -- sbrabec@suse.com
|
|
||||||
Patch16: 0003-Fix-malformed-header-processing.patch
|
|
||||||
BuildRequires: automake >= 1.14
|
BuildRequires: automake >= 1.14
|
||||||
BuildRequires: fdupes
|
BuildRequires: fdupes
|
||||||
BuildRequires: gcc-c++
|
BuildRequires: gcc-c++
|
||||||
|
@@ -1,10 +1,3 @@
|
|||||||
-------------------------------------------------------------------
|
|
||||||
Wed Feb 26 03:01:34 CET 2025 - Stanislav Brabec <sbrabec@suse.com>
|
|
||||||
|
|
||||||
- Fix crash while handling po files with malformed header and
|
|
||||||
process them properly
|
|
||||||
(0003-Fix-malformed-header-processing.patch, boo#1227316).
|
|
||||||
|
|
||||||
-------------------------------------------------------------------
|
-------------------------------------------------------------------
|
||||||
Tue Jul 16 08:42:20 UTC 2024 - Bernhard Wiedemann <bwiedemann@suse.com>
|
Tue Jul 16 08:42:20 UTC 2024 - Bernhard Wiedemann <bwiedemann@suse.com>
|
||||||
|
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
#
|
#
|
||||||
# spec file for package gettext-java
|
# spec file for package gettext-java
|
||||||
#
|
#
|
||||||
# Copyright (c) 2025 SUSE LLC
|
# Copyright (c) 2024 SUSE LLC
|
||||||
#
|
#
|
||||||
# All modifications and additions to the file contributed by third parties
|
# All modifications and additions to the file contributed by third parties
|
||||||
# remain the property of their copyright owners, unless otherwise agreed
|
# remain the property of their copyright owners, unless otherwise agreed
|
||||||
@@ -46,8 +46,6 @@ Patch14: 0001-msgcat-Add-feature-to-use-the-newest-po-file.patch
|
|||||||
Patch15: 0002-msgcat-Merge-headers-when-use-first.patch
|
Patch15: 0002-msgcat-Merge-headers-when-use-first.patch
|
||||||
# PATCH-FIX-UPSTREAM https://lists.gnu.org/archive/html/bug-gettext/2024-07/msg00021.html
|
# PATCH-FIX-UPSTREAM https://lists.gnu.org/archive/html/bug-gettext/2024-07/msg00021.html
|
||||||
Patch16: reproducible-jar.patch
|
Patch16: reproducible-jar.patch
|
||||||
# PATCH-FEATURE-FIX-SUSE boo#1227316 -- sbrabec@suse.com
|
|
||||||
Patch17: 0003-Fix-malformed-header-processing.patch
|
|
||||||
BuildRequires: automake >= 1.14
|
BuildRequires: automake >= 1.14
|
||||||
BuildRequires: fdupes
|
BuildRequires: fdupes
|
||||||
BuildRequires: gcc-c++
|
BuildRequires: gcc-c++
|
||||||
|
@@ -1,16 +1,3 @@
|
|||||||
-------------------------------------------------------------------
|
|
||||||
Wed Feb 26 03:01:34 CET 2025 - Stanislav Brabec <sbrabec@suse.com>
|
|
||||||
|
|
||||||
- Fix crash while handling po files with malformed header and
|
|
||||||
process them properly
|
|
||||||
(0003-Fix-malformed-header-processing.patch, boo#1227316).
|
|
||||||
|
|
||||||
-------------------------------------------------------------------
|
|
||||||
Thu Sep 12 10:43:39 UTC 2024 - Dan Čermák <dcermak@suse.com>
|
|
||||||
|
|
||||||
- Move envsubst requires into main package, gettext.sh is not part of
|
|
||||||
gettext-tools, but gettext-runtime (fixes boo#1227070)
|
|
||||||
|
|
||||||
-------------------------------------------------------------------
|
-------------------------------------------------------------------
|
||||||
Tue Jul 16 08:42:20 UTC 2024 - Bernhard Wiedemann <bwiedemann@suse.com>
|
Tue Jul 16 08:42:20 UTC 2024 - Bernhard Wiedemann <bwiedemann@suse.com>
|
||||||
|
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
#
|
#
|
||||||
# spec file for package gettext-runtime-mini
|
# spec file for package gettext-runtime-mini
|
||||||
#
|
#
|
||||||
# Copyright (c) 2025 SUSE LLC
|
# Copyright (c) 2024 SUSE LLC
|
||||||
#
|
#
|
||||||
# All modifications and additions to the file contributed by third parties
|
# All modifications and additions to the file contributed by third parties
|
||||||
# remain the property of their copyright owners, unless otherwise agreed
|
# remain the property of their copyright owners, unless otherwise agreed
|
||||||
@@ -51,8 +51,6 @@ Requires: this-is-only-for-build-envs
|
|||||||
# rpm-build requires gettext-tools, but we will only just be building it
|
# rpm-build requires gettext-tools, but we will only just be building it
|
||||||
#!BuildIgnore: gettext-tools
|
#!BuildIgnore: gettext-tools
|
||||||
%endif
|
%endif
|
||||||
# gettext.sh requires envsubst
|
|
||||||
Requires: envsubst%{?with_mini:-mini} = %{version}
|
|
||||||
Summary: Tools for Native Language Support (NLS)
|
Summary: Tools for Native Language Support (NLS)
|
||||||
License: GPL-3.0-or-later AND LGPL-2.0-or-later
|
License: GPL-3.0-or-later AND LGPL-2.0-or-later
|
||||||
Group: Development/Tools/Other
|
Group: Development/Tools/Other
|
||||||
@@ -79,8 +77,6 @@ Patch13: reproducible.patch
|
|||||||
# PATCH-FEATURE bsc#1165138
|
# PATCH-FEATURE bsc#1165138
|
||||||
Patch14: 0001-msgcat-Add-feature-to-use-the-newest-po-file.patch
|
Patch14: 0001-msgcat-Add-feature-to-use-the-newest-po-file.patch
|
||||||
Patch15: 0002-msgcat-Merge-headers-when-use-first.patch
|
Patch15: 0002-msgcat-Merge-headers-when-use-first.patch
|
||||||
# PATCH-FEATURE-FIX-SUSE boo#1227316 -- sbrabec@suse.com
|
|
||||||
Patch16: 0003-Fix-malformed-header-processing.patch
|
|
||||||
|
|
||||||
%description
|
%description
|
||||||
This package contains the intl library as well as tools that ease the
|
This package contains the intl library as well as tools that ease the
|
||||||
@@ -96,6 +92,8 @@ License: LGPL-2.1-or-later
|
|||||||
Group: Development/Tools/Other
|
Group: Development/Tools/Other
|
||||||
Requires: %{name} = %{version}
|
Requires: %{name} = %{version}
|
||||||
Requires: xz
|
Requires: xz
|
||||||
|
# gettext.sh requires envsubst
|
||||||
|
Requires: envsubst%{?with_mini:-mini} = %{version}
|
||||||
# autopoint requires find
|
# autopoint requires find
|
||||||
Requires: findutils
|
Requires: findutils
|
||||||
# For non-UTF encodings
|
# For non-UTF encodings
|
||||||
|
@@ -1,16 +1,3 @@
|
|||||||
-------------------------------------------------------------------
|
|
||||||
Wed Feb 26 03:01:34 CET 2025 - Stanislav Brabec <sbrabec@suse.com>
|
|
||||||
|
|
||||||
- Fix crash while handling po files with malformed header and
|
|
||||||
process them properly
|
|
||||||
(0003-Fix-malformed-header-processing.patch, boo#1227316).
|
|
||||||
|
|
||||||
-------------------------------------------------------------------
|
|
||||||
Thu Sep 12 10:43:39 UTC 2024 - Dan Čermák <dcermak@suse.com>
|
|
||||||
|
|
||||||
- Move envsubst requires into main package, gettext.sh is not part of
|
|
||||||
gettext-tools, but gettext-runtime (fixes boo#1227070)
|
|
||||||
|
|
||||||
-------------------------------------------------------------------
|
-------------------------------------------------------------------
|
||||||
Tue Jul 16 08:42:20 UTC 2024 - Bernhard Wiedemann <bwiedemann@suse.com>
|
Tue Jul 16 08:42:20 UTC 2024 - Bernhard Wiedemann <bwiedemann@suse.com>
|
||||||
|
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
#
|
#
|
||||||
# spec file for package gettext-runtime
|
# spec file for package gettext-runtime
|
||||||
#
|
#
|
||||||
# Copyright (c) 2025 SUSE LLC
|
# Copyright (c) 2024 SUSE LLC
|
||||||
#
|
#
|
||||||
# All modifications and additions to the file contributed by third parties
|
# All modifications and additions to the file contributed by third parties
|
||||||
# remain the property of their copyright owners, unless otherwise agreed
|
# remain the property of their copyright owners, unless otherwise agreed
|
||||||
@@ -51,8 +51,6 @@ Requires: this-is-only-for-build-envs
|
|||||||
# rpm-build requires gettext-tools, but we will only just be building it
|
# rpm-build requires gettext-tools, but we will only just be building it
|
||||||
#!BuildIgnore: gettext-tools
|
#!BuildIgnore: gettext-tools
|
||||||
%endif
|
%endif
|
||||||
# gettext.sh requires envsubst
|
|
||||||
Requires: envsubst%{?with_mini:-mini} = %{version}
|
|
||||||
Summary: Tools for Native Language Support (NLS)
|
Summary: Tools for Native Language Support (NLS)
|
||||||
License: GPL-3.0-or-later AND LGPL-2.0-or-later
|
License: GPL-3.0-or-later AND LGPL-2.0-or-later
|
||||||
Group: Development/Tools/Other
|
Group: Development/Tools/Other
|
||||||
@@ -79,8 +77,6 @@ Patch13: reproducible.patch
|
|||||||
# PATCH-FEATURE bsc#1165138
|
# PATCH-FEATURE bsc#1165138
|
||||||
Patch14: 0001-msgcat-Add-feature-to-use-the-newest-po-file.patch
|
Patch14: 0001-msgcat-Add-feature-to-use-the-newest-po-file.patch
|
||||||
Patch15: 0002-msgcat-Merge-headers-when-use-first.patch
|
Patch15: 0002-msgcat-Merge-headers-when-use-first.patch
|
||||||
# PATCH-FEATURE-FIX-SUSE boo#1227316 -- sbrabec@suse.com
|
|
||||||
Patch16: 0003-Fix-malformed-header-processing.patch
|
|
||||||
|
|
||||||
%description
|
%description
|
||||||
This package contains the intl library as well as tools that ease the
|
This package contains the intl library as well as tools that ease the
|
||||||
@@ -96,6 +92,8 @@ License: LGPL-2.1-or-later
|
|||||||
Group: Development/Tools/Other
|
Group: Development/Tools/Other
|
||||||
Requires: %{name} = %{version}
|
Requires: %{name} = %{version}
|
||||||
Requires: xz
|
Requires: xz
|
||||||
|
# gettext.sh requires envsubst
|
||||||
|
Requires: envsubst%{?with_mini:-mini} = %{version}
|
||||||
# autopoint requires find
|
# autopoint requires find
|
||||||
Requires: findutils
|
Requires: findutils
|
||||||
# For non-UTF encodings
|
# For non-UTF encodings
|
||||||
|
Reference in New Issue
Block a user