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/test_socks.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/test_socks.c')
-rw-r--r-- | src/util/test_socks.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/util/test_socks.c b/src/util/test_socks.c index 4b86d25dc..d6064afd5 100644 --- a/src/util/test_socks.c +++ b/src/util/test_socks.c | |||
@@ -51,7 +51,7 @@ copy_msg (void *cls, size_t size, void *buf) | |||
51 | 51 | ||
52 | GNUNET_assert (sizeof (struct GNUNET_MessageHeader) == ntohs (cpy->size)); | 52 | GNUNET_assert (sizeof (struct GNUNET_MessageHeader) == ntohs (cpy->size)); |
53 | GNUNET_assert (size >= ntohs (cpy->size)); | 53 | GNUNET_assert (size >= ntohs (cpy->size)); |
54 | memcpy (buf, cpy, ntohs (cpy->size)); | 54 | GNUNET_memcpy (buf, cpy, ntohs (cpy->size)); |
55 | GNUNET_SERVER_receive_done (ctx->client, GNUNET_OK); | 55 | GNUNET_SERVER_receive_done (ctx->client, GNUNET_OK); |
56 | GNUNET_free (cpy); | 56 | GNUNET_free (cpy); |
57 | GNUNET_free (ctx); | 57 | GNUNET_free (ctx); |
@@ -76,7 +76,7 @@ echo_cb (void *cls, struct GNUNET_SERVER_Client *client, | |||
76 | cc = GNUNET_new (struct CopyContext); | 76 | cc = GNUNET_new (struct CopyContext); |
77 | cc->client = client; | 77 | cc->client = client; |
78 | cpy = GNUNET_malloc (ntohs (message->size)); | 78 | cpy = GNUNET_malloc (ntohs (message->size)); |
79 | memcpy (cpy, message, ntohs (message->size)); | 79 | GNUNET_memcpy (cpy, message, ntohs (message->size)); |
80 | cc->cpy = cpy; | 80 | cc->cpy = cpy; |
81 | GNUNET_assert (NULL != | 81 | GNUNET_assert (NULL != |
82 | GNUNET_SERVER_notify_transmit_ready (client, | 82 | GNUNET_SERVER_notify_transmit_ready (client, |