From 14a19726f09674533803233fbda88fb7087f4038 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Thu, 21 Mar 2024 14:03:36 -0500 Subject: [PATCH] Fix return value of accept() The subscripting to get the `peer` object was wrong. --- shared-module/ssl/SSLSocket.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shared-module/ssl/SSLSocket.c b/shared-module/ssl/SSLSocket.c index 4a51990e6e21..dc9ea5a575f4 100644 --- a/shared-module/ssl/SSLSocket.c +++ b/shared-module/ssl/SSLSocket.c @@ -434,7 +434,7 @@ mp_obj_t common_hal_ssl_sslsocket_accept(ssl_sslsocket_obj_t *self) { mp_obj_t sock = mp_obj_subscr(accepted, MP_OBJ_NEW_SMALL_INT(0), MP_OBJ_SENTINEL); ssl_sslsocket_obj_t *sslsock = common_hal_ssl_sslcontext_wrap_socket(self->ssl_context, sock, true, NULL); do_handshake(sslsock); - mp_obj_t peer = mp_obj_subscr(accepted, MP_OBJ_NEW_SMALL_INT(0), MP_OBJ_SENTINEL); + mp_obj_t peer = mp_obj_subscr(accepted, MP_OBJ_NEW_SMALL_INT(1), MP_OBJ_SENTINEL); mp_obj_t tuple_contents[2]; tuple_contents[0] = MP_OBJ_FROM_PTR(sslsock); tuple_contents[1] = peer;