external/afdko/UnpackedTarball_afdko.mk |    1 +
 external/afdko/mergeFonts_crash.patch   |   31 +++++++++++++++++++++++++++++++
 2 files changed, 32 insertions(+)

New commits:
commit 446322ae5a99473ed88b518f0060cb7ecc004237
Author:     Caolán McNamara <[email protected]>
AuthorDate: Tue Sep 30 10:27:59 2025 +0100
Commit:     Miklos Vajna <[email protected]>
CommitDate: Wed Oct 1 15:27:38 2025 +0200

    fix a crash with all whitespace value content
    
    Change-Id: Ic46eebd10461935a1006f010dbb78dd68f448ddc
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/191675
    Tested-by: Jenkins CollaboraOffice <[email protected]>
    Reviewed-by: Miklos Vajna <[email protected]>

diff --git a/external/afdko/UnpackedTarball_afdko.mk 
b/external/afdko/UnpackedTarball_afdko.mk
index 8914142b77ba..bb7e6b18feec 100644
--- a/external/afdko/UnpackedTarball_afdko.mk
+++ b/external/afdko/UnpackedTarball_afdko.mk
@@ -23,6 +23,7 @@ $(eval $(call gb_UnpackedTarball_add_patches,afdko, \
     external/afdko/extern_mergefonts.patch \
     external/afdko/extern_makeotf.patch \
     external/afdko/warnings.patch \
+    external/afdko/mergeFonts_crash.patch \
 ))
 
 # vim: set noet sw=4 ts=4:
diff --git a/external/afdko/mergeFonts_crash.patch 
b/external/afdko/mergeFonts_crash.patch
new file mode 100644
index 000000000000..b14ea4e1ee91
--- /dev/null
+++ b/external/afdko/mergeFonts_crash.patch
@@ -0,0 +1,31 @@
+--- afdko/c/mergefonts/source/mergeFonts.c
++++ afdko/c/mergefonts/source/mergeFonts.c
+@@ -1177,21 +1177,21 @@
+     if (end == 0)
+         return;
+ 
+-    while (start < MAX_DICT_ENTRY_LEN) {
+-        if ((str[start] == ' ') || (str[start] == '   ') || (str[start] == 
'(') || (str[start] == ' ') || (str[start] == '
'))
+-            start++;
++    while (end >= 0) {
++        if ((str[end] == ' ') || (str[end] == '       ') || (str[end] == ')') 
|| (str[end] == ' ') || (str[end] == '
'))
++            end--;
+         else
+             break;
+     }
++    str[end + 1] = 0;
+ 
+-    while (end >= 0) {
+-        if ((str[end] == ' ') || (str[end] == '       ') || (str[end] == ')') 
|| (str[end] == ' ') || (str[end] == '
'))
+-            end--;
++    while (start < MAX_DICT_ENTRY_LEN) {
++        if ((str[start] == ' ') || (str[start] == '   ') || (str[start] == 
'(') || (str[start] == ' ') || (str[start] == '
'))
++            start++;
+         else
+             break;
+     }
+ 
+-    str[end + 1] = 0;
+     if (start > 0)
+         memmove(str, &str[start], (end - start) + 2);
+     if (strlen(str) == 0) {

Reply via email to