~sircmpwn/gmni-devel

This thread contains a patchset. You're looking at the original emails, but you may wish to use the patch review UI. Review patch
1

[PATCH gmnisrv] disconnect_client: fix index calculation

Details
Message ID
<20210516195347.22020-1-ecs@d2evs.net>
DKIM signature
pass
Download raw message
Patch: +1 -1
This was sometimes causing a gmnisrv_client to be overwritten by the
deinitialized client, which occasionally lead to a segfault when we
later tried to use it.
---
 src/server.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/server.c b/src/server.c
index dac772b..e199f6f 100644
--- a/src/server.c
+++ b/src/server.c
@@ -200,7 +200,7 @@ disconnect_client(struct gmnisrv_server *server, struct gmnisrv_client *client)
	free(client->path);
	client->path = NULL;

	size_t index = (client - server->clients) / sizeof(struct gmnisrv_client);
	size_t index = client - server->clients;
	memmove(&server->clients[index],
		&server->clients[index + 1],
		(server->clientsz - (index + 1)) * sizeof(struct gmnisrv_client));
-- 
2.31.1
Details
Message ID
<CBEXM54FR38E.5U9KR2KDCRRH@taiga>
In-Reply-To
<20210516195347.22020-1-ecs@d2evs.net> (view parent)
DKIM signature
fail
Download raw message
DKIM signature: fail
Nice find. Thanks!

To git@git.sr.ht:~sircmpwn/gmnisrv
   b9a9219..53e4ce4  master -> master
Reply to thread Export thread (mbox)