]> rtime.felk.cvut.cz Git - coffee/buildroot.git/blob - package/libgpg-error/0001-core-Fix-regression-on-arm64-due-to-invalid-use-of-v.patch
libgpg-error: bump to version 1.28
[coffee/buildroot.git] / package / libgpg-error / 0001-core-Fix-regression-on-arm64-due-to-invalid-use-of-v.patch
1 From 791177de023574223eddf7288eb7c5a0721ac623 Mon Sep 17 00:00:00 2001
2 From: Werner Koch <wk@gnupg.org>
3 Date: Sun, 18 Mar 2018 17:39:43 +0100
4 Subject: [PATCH] core: Fix regression on arm64 due to invalid use of va_list.
5
6 * src/logging.c (_gpgrt_log_printhex): Provide a dummy arg instead of
7 NULL.
8 --
9
10 Fix
11 Suggested-by: Jakub Wilk <jwilk@jwilk.net>
12
13 Signed-off-by: Werner Koch <wk@gnupg.org>
14 Signed-off-by: Baruch Siach <baruch@tkos.co.il>
15 ---
16 Upstream status: commit 791177de023
17
18  src/logging.c | 18 ++++++++++++++----
19  1 file changed, 14 insertions(+), 4 deletions(-)
20
21 diff --git a/src/logging.c b/src/logging.c
22 index 1a4f6203d16d..d01f974e4545 100644
23 --- a/src/logging.c
24 +++ b/src/logging.c
25 @@ -1090,9 +1090,10 @@ _gpgrt_log_flush (void)
26  
27  
28  /* Print a hexdump of (BUFFER,LENGTH).  With FMT passed as NULL print
29 - * just the raw dump, with FMT being an empty string, print a trailing
30 - * linefeed, otherwise print an entire debug line with the expanded
31 - * FMT followed by a possible wrapped hexdump and a final LF.  */
32 + * just the raw dump (in this case ARG_PTR is not used), with FMT
33 + * being an empty string, print a trailing linefeed, otherwise print
34 + * an entire debug line with the expanded FMT followed by a possible
35 + * wrapped hexdump and a final LF.  */
36  void
37  _gpgrt_logv_printhex (const void *buffer, size_t length,
38                        const char *fmt, va_list arg_ptr)
39 @@ -1150,7 +1151,16 @@ _gpgrt_log_printhex (const void *buffer, size_t length,
40        va_end (arg_ptr);
41      }
42    else
43 -    _gpgrt_logv_printhex (buffer, length, NULL, NULL);
44 +    {
45 +      /* va_list is not necessary a pointer and thus we can't use NULL
46 +       * because that would conflict with platforms using a straight
47 +       * struct for it (e.g. arm64).  We use a dummy variable instead;
48 +       * the static is a simple way zero it out so to not get
49 +       * complains about uninitialized use.  */
50 +      static va_list dummy_argptr;
51 +
52 +      _gpgrt_logv_printhex (buffer, length, NULL, dummy_argptr);
53 +    }
54  }
55  
56  
57 -- 
58 2.16.2
59