diff options
author | Christian Grothoff <christian@grothoff.org> | 2018-01-05 20:53:20 +0100 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2018-01-05 20:53:45 +0100 |
commit | 8058989645e9fdb0dd13a369c2e2899016d70533 (patch) | |
tree | 51c4d4d7efbcf2221dcbcabef812a2bcb55e639f /src/transport/tcp_connection_legacy.c | |
parent | e2343119b99559b78a2ba727b2c07240c18476ac (diff) | |
download | gnunet-8058989645e9fdb0dd13a369c2e2899016d70533.tar.gz gnunet-8058989645e9fdb0dd13a369c2e2899016d70533.zip |
fix potential use after free in tcp
Diffstat (limited to 'src/transport/tcp_connection_legacy.c')
-rw-r--r-- | src/transport/tcp_connection_legacy.c | 9 |
1 files changed, 6 insertions, 3 deletions
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: | |||
1218 | * @param timeout maximum amount of time to wait | 1218 | * @param timeout maximum amount of time to wait |
1219 | * @param receiver function to call with received data | 1219 | * @param receiver function to call with received data |
1220 | * @param receiver_cls closure for @a receiver | 1220 | * @param receiver_cls closure for @a receiver |
1221 | * @return #GNUNET_SYSERR if @a connection died (receiver was | ||
1222 | * called with error) | ||
1221 | */ | 1223 | */ |
1222 | void | 1224 | int |
1223 | GNUNET_CONNECTION_receive (struct GNUNET_CONNECTION_Handle *connection, | 1225 | GNUNET_CONNECTION_receive (struct GNUNET_CONNECTION_Handle *connection, |
1224 | size_t max, | 1226 | size_t max, |
1225 | struct GNUNET_TIME_Relative timeout, | 1227 | struct GNUNET_TIME_Relative timeout, |
@@ -1241,7 +1243,7 @@ GNUNET_CONNECTION_receive (struct GNUNET_CONNECTION_Handle *connection, | |||
1241 | connection->sock, | 1243 | connection->sock, |
1242 | &receive_ready, | 1244 | &receive_ready, |
1243 | connection); | 1245 | connection); |
1244 | return; | 1246 | return GNUNET_OK; |
1245 | } | 1247 | } |
1246 | if ((NULL == connection->dns_active) && | 1248 | if ((NULL == connection->dns_active) && |
1247 | (NULL == connection->ap_head) && | 1249 | (NULL == connection->ap_head) && |
@@ -1252,8 +1254,9 @@ GNUNET_CONNECTION_receive (struct GNUNET_CONNECTION_Handle *connection, | |||
1252 | NULL, 0, | 1254 | NULL, 0, |
1253 | NULL, 0, | 1255 | NULL, 0, |
1254 | ETIMEDOUT); | 1256 | ETIMEDOUT); |
1255 | return; | 1257 | return GNUNET_SYSERR; |
1256 | } | 1258 | } |
1259 | return GNUNET_OK; | ||
1257 | } | 1260 | } |
1258 | 1261 | ||
1259 | 1262 | ||