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/conversation/gnunet-service-conversation.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/conversation/gnunet-service-conversation.c')
-rw-r--r-- | src/conversation/gnunet-service-conversation.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/conversation/gnunet-service-conversation.c b/src/conversation/gnunet-service-conversation.c index 3b2237229..dcef0f18b 100644 --- a/src/conversation/gnunet-service-conversation.c +++ b/src/conversation/gnunet-service-conversation.c | |||
@@ -774,7 +774,7 @@ transmit_line_audio (void *cls, | |||
774 | mam->header.type = htons (GNUNET_MESSAGE_TYPE_CONVERSATION_CADET_AUDIO); | 774 | mam->header.type = htons (GNUNET_MESSAGE_TYPE_CONVERSATION_CADET_AUDIO); |
775 | mam->remote_line = htonl (ch->remote_line); | 775 | mam->remote_line = htonl (ch->remote_line); |
776 | mam->source_line = htonl (ch->line->local_line); | 776 | mam->source_line = htonl (ch->line->local_line); |
777 | memcpy (&mam[1], ch->audio_data, ch->audio_size); | 777 | GNUNET_memcpy (&mam[1], ch->audio_data, ch->audio_size); |
778 | GNUNET_free (ch->audio_data); | 778 | GNUNET_free (ch->audio_data); |
779 | ch->audio_data = NULL; | 779 | ch->audio_data = NULL; |
780 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 780 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
@@ -869,7 +869,7 @@ handle_client_audio_message (void *cls, | |||
869 | } | 869 | } |
870 | ch->audio_size = size; | 870 | ch->audio_size = size; |
871 | ch->audio_data = GNUNET_malloc (ch->audio_size); | 871 | ch->audio_data = GNUNET_malloc (ch->audio_size); |
872 | memcpy (ch->audio_data, | 872 | GNUNET_memcpy (ch->audio_data, |
873 | &msg[1], | 873 | &msg[1], |
874 | size); | 874 | size); |
875 | ch->unreliable_mth = GNUNET_CADET_notify_transmit_ready (ch->channel_unreliable, | 875 | ch->unreliable_mth = GNUNET_CADET_notify_transmit_ready (ch->channel_unreliable, |
@@ -1328,7 +1328,7 @@ handle_cadet_audio_message (void *cls, | |||
1328 | cam->header.size = htons (sizeof (buf)); | 1328 | cam->header.size = htons (sizeof (buf)); |
1329 | cam->header.type = htons (GNUNET_MESSAGE_TYPE_CONVERSATION_CS_AUDIO); | 1329 | cam->header.type = htons (GNUNET_MESSAGE_TYPE_CONVERSATION_CS_AUDIO); |
1330 | cam->cid = ch->cid; | 1330 | cam->cid = ch->cid; |
1331 | memcpy (&cam[1], &msg[1], msize); | 1331 | GNUNET_memcpy (&cam[1], &msg[1], msize); |
1332 | GNUNET_SERVER_notification_context_unicast (nc, | 1332 | GNUNET_SERVER_notification_context_unicast (nc, |
1333 | ch->line->client, | 1333 | ch->line->client, |
1334 | &cam->header, | 1334 | &cam->header, |