summaryrefslogtreecommitdiff
path: root/src/transport/plugin_transport_smtp.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2016-07-08 17:20:23 +0000
committerChristian Grothoff <christian@grothoff.org>2016-07-08 17:20:23 +0000
commitd8c53b12a818ff7cf82d06a1a69c395bdef85ee6 (patch)
tree0ebb0db416c157fcfde51a941185819dd12d51fd /src/transport/plugin_transport_smtp.c
parent5184c17d32a39c928c2a0fec3ee1ad098bbaa562 (diff)
-avoid calling memcpy() with NULL argument, even if len is 0
Diffstat (limited to 'src/transport/plugin_transport_smtp.c')
-rw-r--r--src/transport/plugin_transport_smtp.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/transport/plugin_transport_smtp.c b/src/transport/plugin_transport_smtp.c
index 0ccf3f7bf..876f81ce3 100644
--- a/src/transport/plugin_transport_smtp.c
+++ b/src/transport/plugin_transport_smtp.c
@@ -325,7 +325,7 @@ api_create_hello ()
haddr = (EmailAddress *) &msg[1];
memset (&haddr->filter[0], 0, FILTER_STRING_SIZE);
strcpy (&haddr->filter[0], filter);
- memcpy (&haddr->senderAddress[0], email, strlen (email) + 1);
+ GNUNET_memcpy (&haddr->senderAddress[0], email, strlen (email) + 1);
msg->senderAddressSize = htons (strlen (email) + 1 + sizeof (EmailAddress));
msg->protocol = htons (GNUNET_TRANSPORT_PROTOCOL_NUMBER_SMTP);
msg->MTU = htonl (smtpAPI.mtu);
@@ -463,7 +463,7 @@ api_send (GNUNET_TSession * tsession, const void *msg, const unsigned int size,
}
GNUNET_free (filter);
m = GNUNET_malloc (size + sizeof (SMTPMessage));
- memcpy (m, msg, size);
+ GNUNET_memcpy (m, msg, size);
mp = (SMTPMessage *) &m[size];
mp->header.size = htons (size + sizeof (SMTPMessage));
mp->header.type = htons (0);
@@ -544,7 +544,7 @@ api_connect (const GNUNET_MessageHello * hello, GNUNET_TSession ** tsessionPtr,
tsession = GNUNET_new (GNUNET_TSession);
tsession->internal = GNUNET_malloc (GNUNET_sizeof_hello (hello));
tsession->peer = hello->senderIdentity;
- memcpy (tsession->internal, hello, GNUNET_sizeof_hello (hello));
+ GNUNET_memcpy (tsession->internal, hello, GNUNET_sizeof_hello (hello));
tsession->ttype = smtpAPI.protocol_number;
(*tsessionPtr) = tsession;
return GNUNET_OK;