From 6d041865665cf4eb776c9d1713b7dd73385b4fb2 Mon Sep 17 00:00:00 2001 From: Matthias Wachs Date: Tue, 21 Dec 2010 16:43:55 +0000 Subject: [PATCH] safety check --- src/transport/gnunet-service-transport.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) 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 */ -- 2.25.1