summaryrefslogtreecommitdiff
path: root/p11-kit/uri.c
diff options
context:
space:
mode:
authorDaiki Ueno <dueno@redhat.com>2017-01-16 14:06:30 +0100
committerDaiki Ueno <ueno@gnu.org>2017-01-17 10:20:27 +0100
commita126365a49547da6b532210a886bb5d5fc531b77 (patch)
tree44c1aac021d75f2f48703da0031433c5bce89825 /p11-kit/uri.c
parent726c08847c263af9c9fd8c74aea738612795dbb6 (diff)
uri: Avoid typecasting confusion on s390x
Like memcpy(), the 'void *' argument of p11_buffer_add() points to the memory area ordered in host's endianness. Add typecast of int->char to avoid the confusion. Reported by Andreas Metzler in: https://lists.freedesktop.org/archives/p11-glue/2017-January/000633.html
Diffstat (limited to 'p11-kit/uri.c')
-rw-r--r--p11-kit/uri.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/p11-kit/uri.c b/p11-kit/uri.c
index 75d2e84..2659fab 100644
--- a/p11-kit/uri.c
+++ b/p11-kit/uri.c
@@ -765,8 +765,10 @@ format_name_equals (p11_buffer *buffer,
enum uri_sep *sep,
const char *name)
{
- if (*sep)
- p11_buffer_add (buffer, sep, 1);
+ if (*sep) {
+ char c = *sep;
+ p11_buffer_add (buffer, &c, 1);
+ }
p11_buffer_add (buffer, name, -1);
p11_buffer_add (buffer, "=", 1);