From: Daiki Ueno Date: Mon, 16 Jan 2017 13:06:30 +0000 (+0100) Subject: uri: Avoid typecasting confusion on s390x X-Git-Tag: 0.23.4~48 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=a126365a49547da6b532210a886bb5d5fc531b77;p=p11-kit 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 --- 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);