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_server_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_server_legacy.c')
-rw-r--r-- | src/transport/tcp_server_legacy.c | 24 |
1 files changed, 14 insertions, 10 deletions
diff --git a/src/transport/tcp_server_legacy.c b/src/transport/tcp_server_legacy.c index d0ce790fc..f75b41e8c 100644 --- a/src/transport/tcp_server_legacy.c +++ b/src/transport/tcp_server_legacy.c | |||
@@ -1044,11 +1044,13 @@ process_mst (struct GNUNET_SERVER_Client *client, | |||
1044 | "Server re-enters receive loop, timeout: %s.\n", | 1044 | "Server re-enters receive loop, timeout: %s.\n", |
1045 | GNUNET_STRINGS_relative_time_to_string (client->idle_timeout, GNUNET_YES)); | 1045 | GNUNET_STRINGS_relative_time_to_string (client->idle_timeout, GNUNET_YES)); |
1046 | client->receive_pending = GNUNET_YES; | 1046 | client->receive_pending = GNUNET_YES; |
1047 | GNUNET_CONNECTION_receive (client->connection, | 1047 | if (GNUNET_OK != |
1048 | GNUNET_MAX_MESSAGE_SIZE - 1, | 1048 | GNUNET_CONNECTION_receive (client->connection, |
1049 | client->idle_timeout, | 1049 | GNUNET_MAX_MESSAGE_SIZE - 1, |
1050 | &process_incoming, | 1050 | client->idle_timeout, |
1051 | client); | 1051 | &process_incoming, |
1052 | client)) | ||
1053 | return; | ||
1052 | break; | 1054 | break; |
1053 | } | 1055 | } |
1054 | LOG (GNUNET_ERROR_TYPE_DEBUG, | 1056 | LOG (GNUNET_ERROR_TYPE_DEBUG, |
@@ -1287,11 +1289,13 @@ GNUNET_SERVER_connect_socket (struct GNUNET_SERVER_Handle *server, | |||
1287 | for (n = server->connect_notify_list_head; NULL != n; n = n->next) | 1289 | for (n = server->connect_notify_list_head; NULL != n; n = n->next) |
1288 | n->callback (n->callback_cls, client); | 1290 | n->callback (n->callback_cls, client); |
1289 | client->receive_pending = GNUNET_YES; | 1291 | client->receive_pending = GNUNET_YES; |
1290 | GNUNET_CONNECTION_receive (client->connection, | 1292 | if (GNUNET_SYSERR == |
1291 | GNUNET_MAX_MESSAGE_SIZE - 1, | 1293 | GNUNET_CONNECTION_receive (client->connection, |
1292 | client->idle_timeout, | 1294 | GNUNET_MAX_MESSAGE_SIZE - 1, |
1293 | &process_incoming, | 1295 | client->idle_timeout, |
1294 | client); | 1296 | &process_incoming, |
1297 | client)) | ||
1298 | return NULL; | ||
1295 | return client; | 1299 | return client; |
1296 | } | 1300 | } |
1297 | 1301 | ||