aboutsummaryrefslogtreecommitdiff
path: root/src/pq/pq_query_helper.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/pq/pq_query_helper.c')
-rw-r--r--src/pq/pq_query_helper.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/src/pq/pq_query_helper.c b/src/pq/pq_query_helper.c
index 2ffadbd75..cc24598e5 100644
--- a/src/pq/pq_query_helper.c
+++ b/src/pq/pq_query_helper.c
@@ -768,8 +768,11 @@ qconv_array (
768 for (unsigned int i = 0; i < num; i++) 768 for (unsigned int i = 0; i < num; i++)
769 { 769 {
770 size_t sz = same_sized ? meta->same_size : sizes[i]; 770 size_t sz = same_sized ? meta->same_size : sizes[i];
771 size_t hsz = htonl (sz);
771 772
772 *(uint32_t *) out = htonl (sz); 773 GNUNET_memcpy (out,
774 &hsz,
775 sizeof(hsz));
773 out += sizeof(uint32_t); 776 out += sizeof(uint32_t);
774 777
775 switch (meta->typ) 778 switch (meta->typ)
@@ -790,8 +793,13 @@ qconv_array (
790 } 793 }
791 case array_of_uint32: 794 case array_of_uint32:
792 { 795 {
796 uint32_t v;
793 GNUNET_assert (sizeof(uint32_t) == sz); 797 GNUNET_assert (sizeof(uint32_t) == sz);
794 *(uint32_t *) out = htonl (*(uint32_t *) in); 798
799 v = htonl (*(uint32_t *) in);
800 GNUNET_memcpy (out,
801 &v,
802 sizeof(v));
795 in += sz; 803 in += sz;
796 break; 804 break;
797 } 805 }
@@ -1166,8 +1174,8 @@ GNUNET_PQ_query_param_array_string (
1166struct GNUNET_PQ_QueryParam 1174struct GNUNET_PQ_QueryParam
1167GNUNET_PQ_query_param_array_ptrs_string ( 1175GNUNET_PQ_query_param_array_ptrs_string (
1168 unsigned int num, 1176 unsigned int num,
1169 const char *elements[static num], 1177 const char *elements[],
1170 const struct GNUNET_PQ_Context *db) 1178 struct GNUNET_PQ_Context *db)
1171{ 1179{
1172 Oid oid; 1180 Oid oid;
1173 1181