summaryrefslogtreecommitdiffstats
path: root/external/icu/ubsan.patch.1
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 09:06:44 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 09:06:44 +0000
commited5640d8b587fbcfed7dd7967f3de04b37a76f26 (patch)
tree7a5f7c6c9d02226d7471cb3cc8fbbf631b415303 /external/icu/ubsan.patch.1
parentInitial commit. (diff)
downloadlibreoffice-upstream/4%7.4.7.tar.xz
libreoffice-upstream/4%7.4.7.zip
Adding upstream version 4:7.4.7.upstream/4%7.4.7upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r--external/icu/ubsan.patch.131
1 files changed, 31 insertions, 0 deletions
diff --git a/external/icu/ubsan.patch.1 b/external/icu/ubsan.patch.1
new file mode 100644
index 000000000..1c10f8cef
--- /dev/null
+++ b/external/icu/ubsan.patch.1
@@ -0,0 +1,31 @@
+diff -ur icu.org/source/tools/genrb/rbutil.c icu/source/tools/genrb/rbutil.c
+--- icu.org/source/tools/genrb/rbutil.c 2020-10-28 22:21:12.000000000 +0100
++++ icu/source/tools/genrb/rbutil.c 2020-11-16 19:50:44.005119253 +0100
+@@ -30,7 +30,12 @@
+ get_dirname(char *dirname,
+ const char *filename)
+ {
+- const char *lastSlash = uprv_strrchr(filename, U_FILE_SEP_CHAR) + 1;
++ const char *lastSlash = uprv_strrchr(filename, U_FILE_SEP_CHAR);
++ if(lastSlash == NULL) {
++ lastSlash = filename;
++ } else {
++ ++lastSlash;
++ }
+
+ if(lastSlash>filename) {
+ uprv_strncpy(dirname, filename, (lastSlash - filename));
+@@ -46,7 +51,12 @@
+ const char *filename)
+ {
+ /* strip off any leading directory portions */
+- const char *lastSlash = uprv_strrchr(filename, U_FILE_SEP_CHAR) + 1;
++ const char *lastSlash = uprv_strrchr(filename, U_FILE_SEP_CHAR);
++ if(lastSlash == NULL) {
++ lastSlash = filename;
++ } else {
++ ++lastSlash;
++ }
+ char *lastDot;
+
+ if(lastSlash>filename) {