summaryrefslogtreecommitdiffstats
path: root/external/gpgmepp/ubsan.patch
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-15 05:54:39 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-15 05:54:39 +0000
commit267c6f2ac71f92999e969232431ba04678e7437e (patch)
tree358c9467650e1d0a1d7227a21dac2e3d08b622b2 /external/gpgmepp/ubsan.patch
parentInitial commit. (diff)
downloadlibreoffice-267c6f2ac71f92999e969232431ba04678e7437e.tar.xz
libreoffice-267c6f2ac71f92999e969232431ba04678e7437e.zip
Adding upstream version 4:24.2.0.upstream/4%24.2.0
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'external/gpgmepp/ubsan.patch')
-rw-r--r--external/gpgmepp/ubsan.patch46
1 files changed, 46 insertions, 0 deletions
diff --git a/external/gpgmepp/ubsan.patch b/external/gpgmepp/ubsan.patch
new file mode 100644
index 0000000000..c23ab80ad0
--- /dev/null
+++ b/external/gpgmepp/ubsan.patch
@@ -0,0 +1,46 @@
+--- src/engine-gpg.c
++++ src/engine-gpg.c
+@@ -62,6 +62,15 @@
+ building command line to this location. */
+ char arg[FLEXIBLE_ARRAY_MEMBER]; /* Used if data above is not used. */
+ };
++struct arg_without_data_s
++{
++ struct arg_and_data_s *next;
++ gpgme_data_t data;
++ int inbound;
++ int dup_to;
++ int print_fd;
++ int *arg_locp;
++};
+
+
+ struct fd_data_map_s
+@@ -335,19 +344,20 @@
+ a = malloc (offsetof (struct arg_and_data_s, arg));
+ if (!a)
+ return gpg_error_from_syserror ();
+- a->data = data;
+- a->inbound = inbound;
+- a->arg_locp = NULL;
++ struct arg_without_data_s *a2 = (struct arg_without_data_s *)a;
++ a2->data = data;
++ a2->inbound = inbound;
++ a2->arg_locp = NULL;
+
+ if (dup_to == -2)
+ {
+- a->print_fd = 1;
+- a->dup_to = -1;
++ a2->print_fd = 1;
++ a2->dup_to = -1;
+ }
+ else
+ {
+- a->print_fd = 0;
+- a->dup_to = dup_to;
++ a2->print_fd = 0;
++ a2->dup_to = dup_to;
+ }
+
+ if (front)