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/util/server_nc.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/util/server_nc.c')
-rw-r--r-- | src/util/server_nc.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/util/server_nc.c b/src/util/server_nc.c index 75c9e1bc2..a95cd7f6d 100644 --- a/src/util/server_nc.c +++ b/src/util/server_nc.c | |||
@@ -326,7 +326,7 @@ transmit_message (void *cls, | |||
326 | "Copying message of type %u and size %u from pending queue to transmission buffer\n", | 326 | "Copying message of type %u and size %u from pending queue to transmission buffer\n", |
327 | ntohs (pml->msg->type), | 327 | ntohs (pml->msg->type), |
328 | msize); | 328 | msize); |
329 | memcpy (&cbuf[ret], pml->msg, msize); | 329 | GNUNET_memcpy (&cbuf[ret], pml->msg, msize); |
330 | ret += msize; | 330 | ret += msize; |
331 | size -= msize; | 331 | size -= msize; |
332 | GNUNET_free (pml); | 332 | GNUNET_free (pml); |
@@ -391,7 +391,7 @@ do_unicast (struct GNUNET_SERVER_NotificationContext *nc, | |||
391 | ntohs (msg->type), | 391 | ntohs (msg->type), |
392 | ntohs (msg->size), | 392 | ntohs (msg->size), |
393 | (unsigned int) nc->queue_length); | 393 | (unsigned int) nc->queue_length); |
394 | memcpy (&pml[1], msg, size); | 394 | GNUNET_memcpy (&pml[1], msg, size); |
395 | /* append */ | 395 | /* append */ |
396 | GNUNET_CONTAINER_DLL_insert_tail (client->pending_head, | 396 | GNUNET_CONTAINER_DLL_insert_tail (client->pending_head, |
397 | client->pending_tail, | 397 | client->pending_tail, |