From 8058989645e9fdb0dd13a369c2e2899016d70533 Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Fri, 5 Jan 2018 20:53:20 +0100 Subject: fix potential use after free in tcp --- src/transport/tcp_connection_legacy.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'src/transport/tcp_connection_legacy.c') diff --git a/src/transport/tcp_connection_legacy.c b/src/transport/tcp_connection_legacy.c index 5b219a467..17157436d 100644 --- a/src/transport/tcp_connection_legacy.c +++ b/src/transport/tcp_connection_legacy.c @@ -1218,8 +1218,10 @@ RETRY: * @param timeout maximum amount of time to wait * @param receiver function to call with received data * @param receiver_cls closure for @a receiver + * @return #GNUNET_SYSERR if @a connection died (receiver was + * called with error) */ -void +int GNUNET_CONNECTION_receive (struct GNUNET_CONNECTION_Handle *connection, size_t max, struct GNUNET_TIME_Relative timeout, @@ -1241,7 +1243,7 @@ GNUNET_CONNECTION_receive (struct GNUNET_CONNECTION_Handle *connection, connection->sock, &receive_ready, connection); - return; + return GNUNET_OK; } if ((NULL == connection->dns_active) && (NULL == connection->ap_head) && @@ -1252,8 +1254,9 @@ GNUNET_CONNECTION_receive (struct GNUNET_CONNECTION_Handle *connection, NULL, 0, NULL, 0, ETIMEDOUT); - return; + return GNUNET_SYSERR; } + return GNUNET_OK; } -- cgit v1.2.3