aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbartpolot <bartpolot@140774ce-b5e7-0310-ab8b-a85725594a96>2012-07-17 17:16:18 +0000
committerbartpolot <bartpolot@140774ce-b5e7-0310-ab8b-a85725594a96>2012-07-17 17:16:18 +0000
commit84f106df4bd8b7d5f6c1b0003af27bc486c47661 (patch)
tree87aa58d91d70377e5255a515b6169e90c19ffe49
parent6e1c444354ad6d5a68a121d1bbfa85985856727d (diff)
- fixed use after free #2499
git-svn-id: https://gnunet.org/svn/gnunet@22724 140774ce-b5e7-0310-ab8b-a85725594a96
-rw-r--r--src/dht/dht_api.c4
-rw-r--r--src/dht/gnunet-service-dht_clients.c1
2 files changed, 3 insertions, 2 deletions
diff --git a/src/dht/dht_api.c b/src/dht/dht_api.c
index cce9f8b8c3..46436755b4 100644
--- a/src/dht/dht_api.c
+++ b/src/dht/dht_api.c
@@ -881,8 +881,8 @@ service_message_handler (void *cls, const struct GNUNET_MessageHeader *msg)
default:
GNUNET_break(0);
LOG (GNUNET_ERROR_TYPE_WARNING,
- "Unknown DHT message type: %hu\n",
- ntohs (msg->type));
+ "Unknown DHT message type: %hu (%hu) size: %hu\n",
+ ntohs (msg->type), msg->type, msize);
break;
}
if (GNUNET_OK != ret)
diff --git a/src/dht/gnunet-service-dht_clients.c b/src/dht/gnunet-service-dht_clients.c
index 173a1c3efd..a67155b894 100644
--- a/src/dht/gnunet-service-dht_clients.c
+++ b/src/dht/gnunet-service-dht_clients.c
@@ -984,6 +984,7 @@ forward_reply (void *cls, const struct GNUNET_HashCode * key, void *value)
memcpy (pm, frc->pm,
sizeof (struct PendingMessage) + ntohs (frc->pm->msg->size));
pm->next = pm->prev = NULL;
+ pm->msg = (struct GNUNET_MessageHeader *) &pm[1];
}
GNUNET_STATISTICS_update (GDS_stats,
gettext_noop ("# RESULTS queued for clients"), 1,