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, 13 insertions, 3 deletions
diff --git a/src/pq/pq_query_helper.c b/src/pq/pq_query_helper.c
index 2293c8005..0199f21dd 100644
--- a/src/pq/pq_query_helper.c
+++ b/src/pq/pq_query_helper.c
@@ -797,8 +797,13 @@ qconv_array (
797 } 797 }
798 case array_of_uint64: 798 case array_of_uint64:
799 { 799 {
800 uint64_t tmp;
800 GNUNET_assert (sizeof(uint64_t) == sz); 801 GNUNET_assert (sizeof(uint64_t) == sz);
801 *(uint64_t *) out = GNUNET_htonll (*(uint64_t *) in); 802
803 tmp = GNUNET_htonll (*(uint64_t *) in);
804 GNUNET_memcpy (out,
805 &tmp,
806 sizeof(tmp));
802 in += sz; 807 in += sz;
803 break; 808 break;
804 } 809 }
@@ -815,7 +820,9 @@ qconv_array (
815 else 820 else
816 ptr = ((const void **) data)[i]; 821 ptr = ((const void **) data)[i];
817 822
818 GNUNET_memcpy (out, ptr, sz); 823 GNUNET_memcpy (out,
824 ptr,
825 sz);
819 break; 826 break;
820 } 827 }
821 case array_of_abs_time: 828 case array_of_abs_time:
@@ -874,7 +881,10 @@ qconv_array (
874 if (val > INT64_MAX) 881 if (val > INT64_MAX)
875 val = INT64_MAX; 882 val = INT64_MAX;
876 883
877 *(uint64_t *) out = GNUNET_htonll (val); 884 val = GNUNET_htonll (val);
885 GNUNET_memcpy (out,
886 &val,
887 sizeof(val));
878 888
879 if (meta->continuous) 889 if (meta->continuous)
880 in += sz; 890 in += sz;