diff options
author | Christian Grothoff <christian@grothoff.org> | 2016-07-08 17:20:23 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2016-07-08 17:20:23 +0000 |
commit | d8c53b12a818ff7cf82d06a1a69c395bdef85ee6 (patch) | |
tree | 0ebb0db416c157fcfde51a941185819dd12d51fd /src/set/gnunet-service-set_union.c | |
parent | 5184c17d32a39c928c2a0fec3ee1ad098bbaa562 (diff) | |
download | gnunet-d8c53b12a818ff7cf82d06a1a69c395bdef85ee6.tar.gz gnunet-d8c53b12a818ff7cf82d06a1a69c395bdef85ee6.zip |
-avoid calling memcpy() with NULL argument, even if len is 0
Diffstat (limited to 'src/set/gnunet-service-set_union.c')
-rw-r--r-- | src/set/gnunet-service-set_union.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/set/gnunet-service-set_union.c b/src/set/gnunet-service-set_union.c index c7f30a741..669e34c8f 100644 --- a/src/set/gnunet-service-set_union.c +++ b/src/set/gnunet-service-set_union.c | |||
@@ -663,7 +663,7 @@ send_strata_estimator (struct Operation *op) | |||
663 | ev = GNUNET_MQ_msg_header_extra (strata_msg, | 663 | ev = GNUNET_MQ_msg_header_extra (strata_msg, |
664 | len, | 664 | len, |
665 | type); | 665 | type); |
666 | memcpy (&strata_msg[1], | 666 | GNUNET_memcpy (&strata_msg[1], |
667 | buf, | 667 | buf, |
668 | len); | 668 | len); |
669 | GNUNET_free (buf); | 669 | GNUNET_free (buf); |
@@ -973,7 +973,7 @@ decode_and_send (struct Operation *op) | |||
973 | sizeof (struct IBF_Key), | 973 | sizeof (struct IBF_Key), |
974 | GNUNET_MESSAGE_TYPE_SET_UNION_P2P_INQUIRY); | 974 | GNUNET_MESSAGE_TYPE_SET_UNION_P2P_INQUIRY); |
975 | msg->salt = htonl (op->state->salt_receive); | 975 | msg->salt = htonl (op->state->salt_receive); |
976 | memcpy (&msg[1], | 976 | GNUNET_memcpy (&msg[1], |
977 | &key, | 977 | &key, |
978 | sizeof (struct IBF_Key)); | 978 | sizeof (struct IBF_Key)); |
979 | LOG (GNUNET_ERROR_TYPE_DEBUG, | 979 | LOG (GNUNET_ERROR_TYPE_DEBUG, |
@@ -1141,7 +1141,7 @@ send_client_element (struct Operation *op, | |||
1141 | rm->result_status = htons (status); | 1141 | rm->result_status = htons (status); |
1142 | rm->request_id = htonl (op->spec->client_request_id); | 1142 | rm->request_id = htonl (op->spec->client_request_id); |
1143 | rm->element_type = element->element_type; | 1143 | rm->element_type = element->element_type; |
1144 | memcpy (&rm[1], element->data, element->size); | 1144 | GNUNET_memcpy (&rm[1], element->data, element->size); |
1145 | GNUNET_MQ_send (op->spec->set->client_mq, ev); | 1145 | GNUNET_MQ_send (op->spec->set->client_mq, ev); |
1146 | } | 1146 | } |
1147 | 1147 | ||
@@ -1239,7 +1239,7 @@ handle_p2p_elements (void *cls, | |||
1239 | 1239 | ||
1240 | element_size = ntohs (mh->size) - sizeof (struct GNUNET_SET_ElementMessage); | 1240 | element_size = ntohs (mh->size) - sizeof (struct GNUNET_SET_ElementMessage); |
1241 | ee = GNUNET_malloc (sizeof (struct ElementEntry) + element_size); | 1241 | ee = GNUNET_malloc (sizeof (struct ElementEntry) + element_size); |
1242 | memcpy (&ee[1], &emsg[1], element_size); | 1242 | GNUNET_memcpy (&ee[1], &emsg[1], element_size); |
1243 | ee->element.size = element_size; | 1243 | ee->element.size = element_size; |
1244 | ee->element.data = &ee[1]; | 1244 | ee->element.data = &ee[1]; |
1245 | ee->element.element_type = ntohs (emsg->element_type); | 1245 | ee->element.element_type = ntohs (emsg->element_type); |
@@ -1397,7 +1397,7 @@ handle_p2p_demand (void *cls, | |||
1397 | return; | 1397 | return; |
1398 | } | 1398 | } |
1399 | ev = GNUNET_MQ_msg_extra (emsg, ee->element.size, GNUNET_MESSAGE_TYPE_SET_P2P_ELEMENTS); | 1399 | ev = GNUNET_MQ_msg_extra (emsg, ee->element.size, GNUNET_MESSAGE_TYPE_SET_P2P_ELEMENTS); |
1400 | memcpy (&emsg[1], ee->element.data, ee->element.size); | 1400 | GNUNET_memcpy (&emsg[1], ee->element.data, ee->element.size); |
1401 | emsg->reserved = htons (0); | 1401 | emsg->reserved = htons (0); |
1402 | emsg->element_type = htons (ee->element.element_type); | 1402 | emsg->element_type = htons (ee->element.element_type); |
1403 | LOG (GNUNET_ERROR_TYPE_DEBUG, | 1403 | LOG (GNUNET_ERROR_TYPE_DEBUG, |