summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Ser <contact@emersion.fr>2025-03-12 08:36:08 +0100
committerKenny Levinsen <kl@kl.wtf>2025-03-18 22:31:44 +0100
commit429e860a37daf096a136c5ae5d28271aaf99b6ac (patch)
tree6ae6b0b8cc78e05a4fa22bd0371fe7fd48f55e89
parentf18bc29ebe27397bebeeafb1c467f53179c72f81 (diff)
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.
-rw-r--r--comm.c1
1 files changed, 1 insertions, 0 deletions
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;
}