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_wlan.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_wlan.c')
-rw-r--r-- | src/transport/plugin_transport_wlan.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/transport/plugin_transport_wlan.c b/src/transport/plugin_transport_wlan.c index 9c9c1e8c2..76fb1ce5a 100644 --- a/src/transport/plugin_transport_wlan.c +++ b/src/transport/plugin_transport_wlan.c | |||
@@ -732,7 +732,7 @@ send_ack (void *cls, | |||
732 | &radio_header->frame, | 732 | &radio_header->frame, |
733 | &endpoint->wlan_addr.mac, | 733 | &endpoint->wlan_addr.mac, |
734 | sizeof (endpoint->wlan_addr.mac)); | 734 | sizeof (endpoint->wlan_addr.mac)); |
735 | memcpy (&radio_header[1], hdr, msize); | 735 | GNUNET_memcpy (&radio_header[1], hdr, msize); |
736 | if (NULL != | 736 | if (NULL != |
737 | GNUNET_HELPER_send (endpoint->plugin->suid_helper, | 737 | GNUNET_HELPER_send (endpoint->plugin->suid_helper, |
738 | &radio_header->header, | 738 | &radio_header->header, |
@@ -996,7 +996,7 @@ transmit_fragment (void *cls, | |||
996 | &radio_header->frame, | 996 | &radio_header->frame, |
997 | &endpoint->wlan_addr.mac, | 997 | &endpoint->wlan_addr.mac, |
998 | sizeof (endpoint->wlan_addr.mac)); | 998 | sizeof (endpoint->wlan_addr.mac)); |
999 | memcpy (&radio_header[1], hdr, msize); | 999 | GNUNET_memcpy (&radio_header[1], hdr, msize); |
1000 | GNUNET_assert (NULL == fm->sh); | 1000 | GNUNET_assert (NULL == fm->sh); |
1001 | fm->sh = GNUNET_HELPER_send (endpoint->plugin->suid_helper, | 1001 | fm->sh = GNUNET_HELPER_send (endpoint->plugin->suid_helper, |
1002 | &radio_header->header, | 1002 | &radio_header->header, |
@@ -1417,7 +1417,7 @@ wlan_plugin_send (void *cls, | |||
1417 | wlanheader->sender = *plugin->env->my_identity; | 1417 | wlanheader->sender = *plugin->env->my_identity; |
1418 | wlanheader->target = session->target; | 1418 | wlanheader->target = session->target; |
1419 | wlanheader->crc = htonl (GNUNET_CRYPTO_crc32_n (msgbuf, msgbuf_size)); | 1419 | wlanheader->crc = htonl (GNUNET_CRYPTO_crc32_n (msgbuf, msgbuf_size)); |
1420 | memcpy (&wlanheader[1], | 1420 | GNUNET_memcpy (&wlanheader[1], |
1421 | msgbuf, | 1421 | msgbuf, |
1422 | msgbuf_size); | 1422 | msgbuf_size); |
1423 | GNUNET_STATISTICS_update (plugin->env->stats, | 1423 | GNUNET_STATISTICS_update (plugin->env->stats, |
@@ -1704,7 +1704,7 @@ send_hello_beacon (void *cls) | |||
1704 | (unsigned int) size, | 1704 | (unsigned int) size, |
1705 | mac_to_string (&bc_all_mac)); | 1705 | mac_to_string (&bc_all_mac)); |
1706 | get_wlan_header (plugin, &radioHeader->frame, &bc_all_mac, size); | 1706 | get_wlan_header (plugin, &radioHeader->frame, &bc_all_mac, size); |
1707 | memcpy (&radioHeader[1], hello, hello_size); | 1707 | GNUNET_memcpy (&radioHeader[1], hello, hello_size); |
1708 | if (NULL != | 1708 | if (NULL != |
1709 | GNUNET_HELPER_send (plugin->suid_helper, | 1709 | GNUNET_HELPER_send (plugin->suid_helper, |
1710 | &radioHeader->header, | 1710 | &radioHeader->header, |