summaryrefslogtreecommitdiff
path: root/src/transport
diff options
context:
space:
mode:
authorMatthias Wachs <wachs@net.in.tum.de>2012-02-01 14:59:30 +0000
committerMatthias Wachs <wachs@net.in.tum.de>2012-02-01 14:59:30 +0000
commit2310f240b57d879b945924e300211b637cd29096 (patch)
tree01cd6543be6eefc25336a228cddae17bd996793e /src/transport
parent53e8a4a55381c9a2b085925b155fd485f3013c8d (diff)
fix 2 crashes in blacklisting api
- client transmit handle was not sent to NULL after sending - BlacklistMessage was not checked for NULL
Diffstat (limited to 'src/transport')
-rw-r--r--src/transport/transport_api_blacklist.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/transport/transport_api_blacklist.c b/src/transport/transport_api_blacklist.c
index b3fc79def..b1c536a9d 100644
--- a/src/transport/transport_api_blacklist.c
+++ b/src/transport/transport_api_blacklist.c
@@ -103,7 +103,9 @@ query_handler (void *cls, const struct GNUNET_MessageHeader *msg)
struct GNUNET_TRANSPORT_Blacklist *br = cls;
const struct BlacklistMessage *bm;
- if ((ntohs (msg->size) != sizeof (struct BlacklistMessage)) ||
+ GNUNET_assert (br != NULL);
+ if ((NULL == msg) ||
+ (ntohs (msg->size) != sizeof (struct BlacklistMessage)) ||
(ntohs (msg->type) != GNUNET_MESSAGE_TYPE_TRANSPORT_BLACKLIST_QUERY))
{
reconnect (br);
@@ -151,6 +153,7 @@ transmit_blacklist_init (void *cls, size_t size, void *buf)
req.size = htons (sizeof (struct GNUNET_MessageHeader));
req.type = htons (GNUNET_MESSAGE_TYPE_TRANSPORT_BLACKLIST_INIT);
memcpy (buf, &req, sizeof (req));
+ br->th = NULL;
receive (br);
return sizeof (req);
}
@@ -201,6 +204,7 @@ transmit_blacklist_reply (void *cls, size_t size, void *buf)
req.is_allowed = htonl (br->cb (br->cb_cls, &br->peer));
req.peer = br->peer;
memcpy (buf, &req, sizeof (req));
+ br->th = NULL;
receive (br);
return sizeof (req);
}