summaryrefslogtreecommitdiffstats
path: root/meta/recipes-support/icu/icu/0001-pkgdata-increase-command-buffer-size.patch
blob: a5483568bb2258097f70436e49cce80a625d3816 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
From ab6b1acdeed76899f8227c38ab7e7675c7673ff1 Mon Sep 17 00:00:00 2001
From: Joe Slater <joe.slater@windriver.com>
Date: Thu, 5 Aug 2021 09:23:48 -0700
Subject: [PATCH 1/1] pkgdata: increase command buffer size

Make cmd LARGE_BUFFER_SIZE to avoid pathname truncation
when install paths are longer than about 150 characters.

https://unicode-org.atlassian.net/browse/ICU-21702 has been
created to address this issue and error reporting.

Upstream-Status: Submitted [ICU-21702 opened]

Signed-off-by: Joe Slater <joe.slater@windriver.com>
---
 source/tools/pkgdata/pkgdata.cpp | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/source/tools/pkgdata/pkgdata.cpp b/source/tools/pkgdata/pkgdata.cpp
index 5ab682e..d4b70ef 100644
--- a/tools/pkgdata/pkgdata.cpp
+++ b/tools/pkgdata/pkgdata.cpp
@@ -1131,17 +1131,17 @@ normal_symlink_mode:
 
 static int32_t pkg_installLibrary(const char *installDir, const char *targetDir, UBool noVersion) {
     int32_t result = 0;
-    char cmd[SMALL_BUFFER_MAX_SIZE];
+    char cmd[LARGE_BUFFER_MAX_SIZE];
 
     auto ret = snprintf(cmd,
-            SMALL_BUFFER_MAX_SIZE,
+            LARGE_BUFFER_MAX_SIZE,
             "cd %s && %s %s %s%s%s",
             targetDir,
             pkgDataFlags[INSTALL_CMD],
             libFileNames[LIB_FILE_VERSION],
             installDir, PKGDATA_FILE_SEP_STRING, libFileNames[LIB_FILE_VERSION]);
     (void)ret;
-    U_ASSERT(0 <= ret && ret < SMALL_BUFFER_MAX_SIZE);
+    U_ASSERT(0 <= ret && ret < LARGE_BUFFER_MAX_SIZE);
 
     result = runCommand(cmd);
 
-- 
2.29.2