diff options
Diffstat (limited to 'src/transport/plugin_transport_unix.c')
-rw-r--r-- | src/transport/plugin_transport_unix.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/transport/plugin_transport_unix.c b/src/transport/plugin_transport_unix.c index d0566c2d3..49a5e89ed 100644 --- a/src/transport/plugin_transport_unix.c +++ b/src/transport/plugin_transport_unix.c | |||
@@ -563,7 +563,7 @@ unix_address_to_sockaddr (const char *unixpath, | |||
563 | slen = strlen (unixpath); | 563 | slen = strlen (unixpath); |
564 | if (slen >= sizeof (un->sun_path)) | 564 | if (slen >= sizeof (un->sun_path)) |
565 | slen = sizeof (un->sun_path) - 1; | 565 | slen = sizeof (un->sun_path) - 1; |
566 | memcpy (un->sun_path, unixpath, slen); | 566 | GNUNET_memcpy (un->sun_path, unixpath, slen); |
567 | un->sun_path[slen] = '\0'; | 567 | un->sun_path[slen] = '\0'; |
568 | slen = sizeof (struct sockaddr_un); | 568 | slen = sizeof (struct sockaddr_un); |
569 | #if HAVE_SOCKADDR_IN_SIN_LEN | 569 | #if HAVE_SOCKADDR_IN_SIN_LEN |
@@ -1054,7 +1054,7 @@ unix_plugin_do_read (struct Plugin *plugin) | |||
1054 | ua_len = sizeof (struct UnixAddress) + strlen (un.sun_path) + 1; | 1054 | ua_len = sizeof (struct UnixAddress) + strlen (un.sun_path) + 1; |
1055 | ua = GNUNET_malloc (ua_len); | 1055 | ua = GNUNET_malloc (ua_len); |
1056 | ua->addrlen = htonl (strlen (&un.sun_path[0]) +1); | 1056 | ua->addrlen = htonl (strlen (&un.sun_path[0]) +1); |
1057 | memcpy (&ua[1], &un.sun_path[0], strlen (un.sun_path) + 1); | 1057 | GNUNET_memcpy (&ua[1], &un.sun_path[0], strlen (un.sun_path) + 1); |
1058 | if (is_abstract) | 1058 | if (is_abstract) |
1059 | ua->options = htonl(UNIX_OPTIONS_USE_ABSTRACT_SOCKETS); | 1059 | ua->options = htonl(UNIX_OPTIONS_USE_ABSTRACT_SOCKETS); |
1060 | else | 1060 | else |
@@ -1069,7 +1069,7 @@ unix_plugin_do_read (struct Plugin *plugin) | |||
1069 | return; | 1069 | return; |
1070 | } | 1070 | } |
1071 | msgbuf = (char *) &msg[1]; | 1071 | msgbuf = (char *) &msg[1]; |
1072 | memcpy (&sender, | 1072 | GNUNET_memcpy (&sender, |
1073 | &msg->sender, | 1073 | &msg->sender, |
1074 | sizeof (struct GNUNET_PeerIdentity)); | 1074 | sizeof (struct GNUNET_PeerIdentity)); |
1075 | offset = 0; | 1075 | offset = 0; |
@@ -1333,9 +1333,9 @@ unix_plugin_send (void *cls, | |||
1333 | message = GNUNET_malloc (sizeof (struct UNIXMessage) + msgbuf_size); | 1333 | message = GNUNET_malloc (sizeof (struct UNIXMessage) + msgbuf_size); |
1334 | message->header.size = htons (ssize); | 1334 | message->header.size = htons (ssize); |
1335 | message->header.type = htons (0); | 1335 | message->header.type = htons (0); |
1336 | memcpy (&message->sender, plugin->env->my_identity, | 1336 | GNUNET_memcpy (&message->sender, plugin->env->my_identity, |
1337 | sizeof (struct GNUNET_PeerIdentity)); | 1337 | sizeof (struct GNUNET_PeerIdentity)); |
1338 | memcpy (&message[1], msgbuf, msgbuf_size); | 1338 | GNUNET_memcpy (&message[1], msgbuf, msgbuf_size); |
1339 | wrapper = GNUNET_new (struct UNIXMessageWrapper); | 1339 | wrapper = GNUNET_new (struct UNIXMessageWrapper); |
1340 | wrapper->msg = message; | 1340 | wrapper->msg = message; |
1341 | wrapper->msgsize = ssize; | 1341 | wrapper->msgsize = ssize; |
@@ -1598,7 +1598,7 @@ unix_plugin_string_to_address (void *cls, | |||
1598 | ua = GNUNET_malloc (ua_size); | 1598 | ua = GNUNET_malloc (ua_size); |
1599 | ua->options = htonl (options); | 1599 | ua->options = htonl (options); |
1600 | ua->addrlen = htonl (strlen (address) + 1); | 1600 | ua->addrlen = htonl (strlen (address) + 1); |
1601 | memcpy (&ua[1], address, strlen (address) + 1); | 1601 | GNUNET_memcpy (&ua[1], address, strlen (address) + 1); |
1602 | GNUNET_free (plugin); | 1602 | GNUNET_free (plugin); |
1603 | 1603 | ||
1604 | (*buf) = ua; | 1604 | (*buf) = ua; |
@@ -1626,7 +1626,7 @@ address_notification (void *cls) | |||
1626 | ua->options = htonl (plugin->myoptions); | 1626 | ua->options = htonl (plugin->myoptions); |
1627 | ua->addrlen = htonl(strlen (plugin->unix_socket_path) + 1); | 1627 | ua->addrlen = htonl(strlen (plugin->unix_socket_path) + 1); |
1628 | unix_path = (char *) &ua[1]; | 1628 | unix_path = (char *) &ua[1]; |
1629 | memcpy (unix_path, plugin->unix_socket_path, strlen (plugin->unix_socket_path) + 1); | 1629 | GNUNET_memcpy (unix_path, plugin->unix_socket_path, strlen (plugin->unix_socket_path) + 1); |
1630 | 1630 | ||
1631 | plugin->address_update_task = NULL; | 1631 | plugin->address_update_task = NULL; |
1632 | address = GNUNET_HELLO_address_allocate (plugin->env->my_identity, | 1632 | address = GNUNET_HELLO_address_allocate (plugin->env->my_identity, |
@@ -1852,7 +1852,7 @@ libgnunet_plugin_transport_unix_done (void *cls) | |||
1852 | ua = GNUNET_malloc (len); | 1852 | ua = GNUNET_malloc (len); |
1853 | ua->options = htonl (plugin->myoptions); | 1853 | ua->options = htonl (plugin->myoptions); |
1854 | ua->addrlen = htonl(strlen (plugin->unix_socket_path) + 1); | 1854 | ua->addrlen = htonl(strlen (plugin->unix_socket_path) + 1); |
1855 | memcpy (&ua[1], | 1855 | GNUNET_memcpy (&ua[1], |
1856 | plugin->unix_socket_path, | 1856 | plugin->unix_socket_path, |
1857 | strlen (plugin->unix_socket_path) + 1); | 1857 | strlen (plugin->unix_socket_path) + 1); |
1858 | address = GNUNET_HELLO_address_allocate (plugin->env->my_identity, | 1858 | address = GNUNET_HELLO_address_allocate (plugin->env->my_identity, |