File gsoap-02-typepuns.diff of Package gsoap

References: https://sf.net/p/gsoap2/patches/124/

---
 gsoap/plugin/wsaapi.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Index: gsoap-2.8.22/gsoap/plugin/wsaapi.c
===================================================================
--- gsoap-2.8.22.orig/gsoap/plugin/wsaapi.c
+++ gsoap-2.8.22/gsoap/plugin/wsaapi.c
@@ -599,7 +599,7 @@ soap_wsa_rand_uuid(struct soap *soap)
     k += 0x7FFFFFFF;
   r2 = k;
   k &= 0x8FFFFFFF;
-  r2 += *(int*)soap->buf;
+  r2 += soap->buf[0] << 24 + soap->buf[1] << 16 + soap->buf[2] << 8 + soap->buf[3];
 #endif
   r3 = soap_random;
   r4 = soap_random;
diff -ur gsoap-2.8.orig/gsoap/stdsoap2.cpp gsoap-2.8/gsoap/stdsoap2.cpp
--- gsoap-2.8.orig/gsoap/stdsoap2.cpp	2015-04-14 08:46:36.000000000 +0200
+++ gsoap-2.8/gsoap/stdsoap2.cpp	2015-05-05 09:01:31.633153838 +0200
@@ -3105,11 +3105,11 @@
 int
 SOAP_FMAC2
 soap_rand()
-{ unsigned char buf[4];
+{ int buf;
   if (!soap_ssl_init_done)
     soap_ssl_init();
-  RAND_pseudo_bytes(buf, 4);
-  return *(int*)buf;
+  RAND_pseudo_bytes((unsigned char*)&buf, sizeof(int));
+  return buf;
 }
 #endif
 #endif
openSUSE Build Service is sponsored by