From: Matthias Wachs Date: Tue, 21 Dec 2010 16:43:55 +0000 (+0000) Subject: safety check X-Git-Tag: initial-import-from-subversion-38251~19448 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=6d041865665cf4eb776c9d1713b7dd73385b4fb2;p=oweals%2Fgnunet.git safety check --- diff --git a/src/transport/gnunet-service-transport.c b/src/transport/gnunet-service-transport.c index 0bb19a9cf..b2fa62d0d 100644 --- a/src/transport/gnunet-service-transport.c +++ b/src/transport/gnunet-service-transport.c @@ -4516,9 +4516,10 @@ handle_ping(void *cls, const struct GNUNET_MessageHeader *message, memcpy (&pong[1], plugin->short_name, slen); - memcpy (&((char*)&pong[1])[slen], - sender_address, - sender_address_len); + if ((sender_address!=NULL) && (sender_address_len > 0)) + memcpy (&((char*)&pong[1])[slen], + sender_address, + sender_address_len); if (GNUNET_TIME_absolute_get_remaining (session_header->pong_sig_expires).rel_value < PONG_SIGNATURE_LIFETIME.rel_value / 4) { /* create / update cached sig */