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/dht/dht_api.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/dht/dht_api.c')
-rw-r--r-- | src/dht/dht_api.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/dht/dht_api.c b/src/dht/dht_api.c index f67c1075f..0ada41662 100644 --- a/src/dht/dht_api.c +++ b/src/dht/dht_api.c | |||
@@ -291,7 +291,7 @@ send_get (struct GNUNET_DHT_GetHandle *gh) | |||
291 | get_msg->type = htonl (gh->type); | 291 | get_msg->type = htonl (gh->type); |
292 | get_msg->key = gh->key; | 292 | get_msg->key = gh->key; |
293 | get_msg->unique_id = gh->unique_id; | 293 | get_msg->unique_id = gh->unique_id; |
294 | memcpy (&get_msg[1], | 294 | GNUNET_memcpy (&get_msg[1], |
295 | &gh[1], | 295 | &gh[1], |
296 | gh->xquery_size); | 296 | gh->xquery_size); |
297 | GNUNET_MQ_send (h->mq, | 297 | GNUNET_MQ_send (h->mq, |
@@ -332,7 +332,7 @@ send_get_known_results (struct GNUNET_DHT_GetHandle *gh, | |||
332 | GNUNET_MESSAGE_TYPE_DHT_CLIENT_GET_RESULTS_KNOWN); | 332 | GNUNET_MESSAGE_TYPE_DHT_CLIENT_GET_RESULTS_KNOWN); |
333 | msg->key = gh->key; | 333 | msg->key = gh->key; |
334 | msg->unique_id = gh->unique_id; | 334 | msg->unique_id = gh->unique_id; |
335 | memcpy (&msg[1], | 335 | GNUNET_memcpy (&msg[1], |
336 | &gh->seen_results[transmission_offset], | 336 | &gh->seen_results[transmission_offset], |
337 | sizeof (struct GNUNET_HashCode) * delta); | 337 | sizeof (struct GNUNET_HashCode) * delta); |
338 | GNUNET_MQ_send (h->mq, | 338 | GNUNET_MQ_send (h->mq, |
@@ -1014,7 +1014,7 @@ GNUNET_DHT_put (struct GNUNET_DHT_Handle *handle, | |||
1014 | put_msg->unique_id = ph->unique_id; | 1014 | put_msg->unique_id = ph->unique_id; |
1015 | put_msg->expiration = GNUNET_TIME_absolute_hton (exp); | 1015 | put_msg->expiration = GNUNET_TIME_absolute_hton (exp); |
1016 | put_msg->key = *key; | 1016 | put_msg->key = *key; |
1017 | memcpy (&put_msg[1], | 1017 | GNUNET_memcpy (&put_msg[1], |
1018 | data, | 1018 | data, |
1019 | size); | 1019 | size); |
1020 | GNUNET_MQ_send (handle->mq, | 1020 | GNUNET_MQ_send (handle->mq, |
@@ -1098,7 +1098,7 @@ GNUNET_DHT_get_start (struct GNUNET_DHT_Handle *handle, | |||
1098 | gh->desired_replication_level = desired_replication_level; | 1098 | gh->desired_replication_level = desired_replication_level; |
1099 | gh->type = type; | 1099 | gh->type = type; |
1100 | gh->options = options; | 1100 | gh->options = options; |
1101 | memcpy (&gh[1], | 1101 | GNUNET_memcpy (&gh[1], |
1102 | xquery, | 1102 | xquery, |
1103 | xquery_size); | 1103 | xquery_size); |
1104 | GNUNET_CONTAINER_multihashmap_put (handle->active_requests, | 1104 | GNUNET_CONTAINER_multihashmap_put (handle->active_requests, |
@@ -1135,7 +1135,7 @@ GNUNET_DHT_get_filter_known_results (struct GNUNET_DHT_GetHandle *get_handle, | |||
1135 | GNUNET_array_grow (get_handle->seen_results, | 1135 | GNUNET_array_grow (get_handle->seen_results, |
1136 | get_handle->seen_results_size, | 1136 | get_handle->seen_results_size, |
1137 | needed); | 1137 | needed); |
1138 | memcpy (&get_handle->seen_results[get_handle->seen_results_end], | 1138 | GNUNET_memcpy (&get_handle->seen_results[get_handle->seen_results_end], |
1139 | results, | 1139 | results, |
1140 | num_results * sizeof (struct GNUNET_HashCode)); | 1140 | num_results * sizeof (struct GNUNET_HashCode)); |
1141 | get_handle->seen_results_end += num_results; | 1141 | get_handle->seen_results_end += num_results; |