From 429e860a37daf096a136c5ae5d28271aaf99b6ac Mon Sep 17 00:00:00 2001 From: Simon Ser Date: Wed, 12 Mar 2025 08:36:08 +0100 Subject: Assert that password buffer is NULL-terminated read_comm_request() just copies bytes around. handle_conversation() relies on the fact that the password buffer is NULL-terminated. Make sure that's the case. --- comm.c | 1 + 1 file changed, 1 insertion(+) (limited to 'comm.c') diff --git a/comm.c b/comm.c index 5f4c078..16a4da9 100644 --- a/comm.c +++ b/comm.c @@ -72,6 +72,7 @@ ssize_t read_comm_request(char **buf_ptr) { return -1; } + assert(buf[size - 1] == '\0'); *buf_ptr = buf; return size; } -- cgit v1.2.3