diff -ur gsoap-2.8.orig/gsoap/samples/calc_vs2005/calc_vs2005/stdsoap2.cpp gsoap-2.8/gsoap/samples/calc_vs2005/calc_vs2005/stdsoap2.cpp
--- gsoap-2.8.orig/gsoap/samples/calc_vs2005/calc_vs2005/stdsoap2.cpp	2026-04-25 13:33:16.000000000 +0200
+++ gsoap-2.8/gsoap/samples/calc_vs2005/calc_vs2005/stdsoap2.cpp	2026-06-15 19:05:37.487675055 +0200
@@ -10942,6 +10942,7 @@
   struct soap_clist *cp;
   char *p;
   size_t k;
+  unsigned int val;
   if (SOAP_MAXALLOCSIZE > 0 && n > SOAP_MAXALLOCSIZE)
   {
     if (soap)
@@ -10976,7 +10977,8 @@
     soap->error = SOAP_EOM;
     return NULL;
   }
-  *(unsigned int*)(p + n) = (unsigned int)(SOAP_CANARY ^ PtrToUlong(p));
+  val = (unsigned int)(SOAP_CANARY ^ PtrToUlong(p));
+  memcpy(p + n, &val, sizeof(unsigned int));
   cp = &soap->cblk->clist[soap->cidx++];
   k = soap_hash_ptr(p);
   cp->next = soap->cht[k];
@@ -11128,6 +11130,7 @@
 SOAP_FMAC2
 soap_dealloc(struct soap *soap, void *p)
 {
+  unsigned int val;
   if (soap_check_state(soap))
     return SOAP_OK;
   if (p)
@@ -11145,7 +11148,8 @@
         }
         else
         {
-          if (*(unsigned int*)((char*)p + cp->size) != (unsigned int)(SOAP_CANARY ^ PtrToUlong(p)))
+          val = (unsigned int)(SOAP_CANARY ^ PtrToUlong(p));
+          if (memcmp((char*)p + cp->size, &val, sizeof(unsigned int)))
           {
 #ifdef SOAP_MEM_DEBUG
             fprintf(stderr, "Memory corruption detected at %p %zu bytes (see logs)\n", p, (size_t)cp->size);
@@ -11187,7 +11191,8 @@
           }
           else
           {
-            if (*(unsigned int*)((char*)p + cp->size) != (unsigned int)(SOAP_CANARY ^ PtrToUlong(p)))
+            val = (unsigned int)(SOAP_CANARY ^ PtrToUlong(p));
+            if (memcmp((char*)p + cp->size, &val, sizeof(unsigned int)))
             {
 #ifdef SOAP_MEM_DEBUG
               fprintf(stderr, "Memory corruption detected at %p %zu bytes (see logs)\n", p, (size_t)cp->size);
diff -ur gsoap-2.8.orig/gsoap/stdsoap2.c gsoap-2.8/gsoap/stdsoap2.c
--- gsoap-2.8.orig/gsoap/stdsoap2.c	2026-04-25 13:33:17.000000000 +0200
+++ gsoap-2.8/gsoap/stdsoap2.c	2026-06-15 19:05:37.487675055 +0200
@@ -10942,6 +10942,7 @@
   struct soap_clist *cp;
   char *p;
   size_t k;
+  unsigned int val;
   if (SOAP_MAXALLOCSIZE > 0 && n > SOAP_MAXALLOCSIZE)
   {
     if (soap)
@@ -10976,7 +10977,8 @@
     soap->error = SOAP_EOM;
     return NULL;
   }
-  *(unsigned int*)(p + n) = (unsigned int)(SOAP_CANARY ^ PtrToUlong(p));
+  val = (unsigned int)(SOAP_CANARY ^ PtrToUlong(p));
+  memcpy(p + n, &val, sizeof(unsigned int));
   cp = &soap->cblk->clist[soap->cidx++];
   k = soap_hash_ptr(p);
   cp->next = soap->cht[k];
@@ -11128,6 +11130,7 @@
 SOAP_FMAC2
 soap_dealloc(struct soap *soap, void *p)
 {
+  unsigned int val;
   if (soap_check_state(soap))
     return SOAP_OK;
   if (p)
@@ -11145,7 +11148,8 @@
         }
         else
         {
-          if (*(unsigned int*)((char*)p + cp->size) != (unsigned int)(SOAP_CANARY ^ PtrToUlong(p)))
+          val = (unsigned int)(SOAP_CANARY ^ PtrToUlong(p));
+          if (memcmp((char*)p + cp->size, &val, sizeof(unsigned int)))
           {
 #ifdef SOAP_MEM_DEBUG
             fprintf(stderr, "Memory corruption detected at %p %zu bytes (see logs)\n", p, (size_t)cp->size);
@@ -11187,7 +11191,8 @@
           }
           else
           {
-            if (*(unsigned int*)((char*)p + cp->size) != (unsigned int)(SOAP_CANARY ^ PtrToUlong(p)))
+            val = (unsigned int)(SOAP_CANARY ^ PtrToUlong(p));
+            if (memcmp((char*)p + cp->size, &val, sizeof(unsigned int)))
             {
 #ifdef SOAP_MEM_DEBUG
               fprintf(stderr, "Memory corruption detected at %p %zu bytes (see logs)\n", p, (size_t)cp->size);
diff -ur gsoap-2.8.orig/gsoap/stdsoap2.cpp gsoap-2.8/gsoap/stdsoap2.cpp
--- gsoap-2.8.orig/gsoap/stdsoap2.cpp	2026-04-25 13:33:14.000000000 +0200
+++ gsoap-2.8/gsoap/stdsoap2.cpp	2026-06-15 19:05:37.487675055 +0200
@@ -10942,6 +10942,7 @@
   struct soap_clist *cp;
   char *p;
   size_t k;
+  unsigned int val;
   if (SOAP_MAXALLOCSIZE > 0 && n > SOAP_MAXALLOCSIZE)
   {
     if (soap)
@@ -10976,7 +10977,8 @@
     soap->error = SOAP_EOM;
     return NULL;
   }
-  *(unsigned int*)(p + n) = (unsigned int)(SOAP_CANARY ^ PtrToUlong(p));
+  val = (unsigned int)(SOAP_CANARY ^ PtrToUlong(p));
+  memcpy(p + n, &val, sizeof(unsigned int));
   cp = &soap->cblk->clist[soap->cidx++];
   k = soap_hash_ptr(p);
   cp->next = soap->cht[k];
@@ -11128,6 +11130,7 @@
 SOAP_FMAC2
 soap_dealloc(struct soap *soap, void *p)
 {
+  unsigned int val;
   if (soap_check_state(soap))
     return SOAP_OK;
   if (p)
@@ -11145,7 +11148,8 @@
         }
         else
         {
-          if (*(unsigned int*)((char*)p + cp->size) != (unsigned int)(SOAP_CANARY ^ PtrToUlong(p)))
+          val = (unsigned int)(SOAP_CANARY ^ PtrToUlong(p));
+          if (memcmp((char*)p + cp->size, &val, sizeof(unsigned int)))
           {
 #ifdef SOAP_MEM_DEBUG
             fprintf(stderr, "Memory corruption detected at %p %zu bytes (see logs)\n", p, (size_t)cp->size);
@@ -11187,7 +11191,8 @@
           }
           else
           {
-            if (*(unsigned int*)((char*)p + cp->size) != (unsigned int)(SOAP_CANARY ^ PtrToUlong(p)))
+            val = (unsigned int)(SOAP_CANARY ^ PtrToUlong(p));
+            if (memcmp((char*)p + cp->size, &val, sizeof(unsigned int)))
             {
 #ifdef SOAP_MEM_DEBUG
               fprintf(stderr, "Memory corruption detected at %p %zu bytes (see logs)\n", p, (size_t)cp->size);
diff -ur gsoap-2.8.orig/gsoap/VisualStudio2005/wsdl2h/wsdl2h/stdsoap2.cpp gsoap-2.8/gsoap/VisualStudio2005/wsdl2h/wsdl2h/stdsoap2.cpp
--- gsoap-2.8.orig/gsoap/VisualStudio2005/wsdl2h/wsdl2h/stdsoap2.cpp	2026-04-25 13:33:14.000000000 +0200
+++ gsoap-2.8/gsoap/VisualStudio2005/wsdl2h/wsdl2h/stdsoap2.cpp	2026-06-15 19:05:37.487675055 +0200
@@ -10942,6 +10942,7 @@
   struct soap_clist *cp;
   char *p;
   size_t k;
+  unsigned int val;
   if (SOAP_MAXALLOCSIZE > 0 && n > SOAP_MAXALLOCSIZE)
   {
     if (soap)
@@ -10976,7 +10977,8 @@
     soap->error = SOAP_EOM;
     return NULL;
   }
-  *(unsigned int*)(p + n) = (unsigned int)(SOAP_CANARY ^ PtrToUlong(p));
+  val = (unsigned int)(SOAP_CANARY ^ PtrToUlong(p));
+  memcpy(p + n, &val, sizeof(unsigned int));
   cp = &soap->cblk->clist[soap->cidx++];
   k = soap_hash_ptr(p);
   cp->next = soap->cht[k];
@@ -11128,6 +11130,7 @@
 SOAP_FMAC2
 soap_dealloc(struct soap *soap, void *p)
 {
+  unsigned int val;
   if (soap_check_state(soap))
     return SOAP_OK;
   if (p)
@@ -11145,7 +11148,8 @@
         }
         else
         {
-          if (*(unsigned int*)((char*)p + cp->size) != (unsigned int)(SOAP_CANARY ^ PtrToUlong(p)))
+          val = (unsigned int)(SOAP_CANARY ^ PtrToUlong(p));
+          if (memcmp((char*)p + cp->size, &val, sizeof(unsigned int)))
           {
 #ifdef SOAP_MEM_DEBUG
             fprintf(stderr, "Memory corruption detected at %p %zu bytes (see logs)\n", p, (size_t)cp->size);
@@ -11187,7 +11191,8 @@
           }
           else
           {
-            if (*(unsigned int*)((char*)p + cp->size) != (unsigned int)(SOAP_CANARY ^ PtrToUlong(p)))
+            val = (unsigned int)(SOAP_CANARY ^ PtrToUlong(p));
+            if (memcmp((char*)p + cp->size, &val, sizeof(unsigned int)))
             {
 #ifdef SOAP_MEM_DEBUG
               fprintf(stderr, "Memory corruption detected at %p %zu bytes (see logs)\n", p, (size_t)cp->size);
