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/transport/plugin_transport_udp_broadcasting.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/transport/plugin_transport_udp_broadcasting.c')
-rw-r--r-- | src/transport/plugin_transport_udp_broadcasting.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/transport/plugin_transport_udp_broadcasting.c b/src/transport/plugin_transport_udp_broadcasting.c index 6c5efd5f1..e9caa3aa7 100644 --- a/src/transport/plugin_transport_udp_broadcasting.c +++ b/src/transport/plugin_transport_udp_broadcasting.c | |||
@@ -226,7 +226,7 @@ prepare_beacon (struct Plugin *plugin, | |||
226 | msg->sender = *(plugin->env->my_identity); | 226 | msg->sender = *(plugin->env->my_identity); |
227 | msg->header.size = htons (msg_size); | 227 | msg->header.size = htons (msg_size); |
228 | msg->header.type = htons (GNUNET_MESSAGE_TYPE_TRANSPORT_BROADCAST_BEACON); | 228 | msg->header.type = htons (GNUNET_MESSAGE_TYPE_TRANSPORT_BROADCAST_BEACON); |
229 | memcpy (&msg[1], hello, hello_size); | 229 | GNUNET_memcpy (&msg[1], hello, hello_size); |
230 | return msg_size; | 230 | return msg_size; |
231 | } | 231 | } |
232 | 232 | ||
@@ -435,7 +435,7 @@ iface_proc (void *cls, | |||
435 | ba = GNUNET_new (struct BroadcastAddress); | 435 | ba = GNUNET_new (struct BroadcastAddress); |
436 | ba->plugin = plugin; | 436 | ba->plugin = plugin; |
437 | ba->addr = GNUNET_malloc (addrlen); | 437 | ba->addr = GNUNET_malloc (addrlen); |
438 | memcpy (ba->addr, broadcast_addr, addrlen); | 438 | GNUNET_memcpy (ba->addr, broadcast_addr, addrlen); |
439 | ba->addrlen = addrlen; | 439 | ba->addrlen = addrlen; |
440 | 440 | ||
441 | if ( (GNUNET_YES == plugin->enable_ipv4) && | 441 | if ( (GNUNET_YES == plugin->enable_ipv4) && |