From ed5640d8b587fbcfed7dd7967f3de04b37a76f26 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 7 Apr 2024 11:06:44 +0200 Subject: Adding upstream version 4:7.4.7. Signed-off-by: Daniel Baumann --- external/gpgmepp/ubsan.patch | 52 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 external/gpgmepp/ubsan.patch (limited to 'external/gpgmepp/ubsan.patch') diff --git a/external/gpgmepp/ubsan.patch b/external/gpgmepp/ubsan.patch new file mode 100644 index 000000000..2262291cd --- /dev/null +++ b/external/gpgmepp/ubsan.patch @@ -0,0 +1,52 @@ +--- src/engine-gpg.c ++++ src/engine-gpg.c +@@ -61,6 +61,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 +@@ -310,23 +319,24 @@ + a = malloc (offsetof (struct arg_and_data_s, arg)); + if (!a) + return gpg_error_from_syserror (); +- a->next = NULL; +- a->data = data; +- a->inbound = inbound; +- a->arg_locp = NULL; ++ struct arg_without_data_s *a2 = (struct arg_without_data_s *)a; ++ a2->next = NULL; ++ 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; + } + *gpg->argtail = a; +- gpg->argtail = &a->next; ++ gpg->argtail = &a2->next; + return 0; + } + -- cgit v1.2.3