From d141b72593a37bc6c78db39d218f61965373b5c7 Mon Sep 17 00:00:00 2001 From: Joursoir Date: Sun, 4 Jul 2021 17:35:53 +0000 Subject: routines: null-terminate a generated password --- src/routines.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/routines.c b/src/routines.c index 7a434f7..09916aa 100644 --- a/src/routines.c +++ b/src/routines.c @@ -183,6 +183,7 @@ char *gen_password(int length) for(i = 0; i < length; i++) password[i] = allowed_chars[rand() % NUMBER_ALLOWED_CHARS]; + password[i] = '\0'; return password; } -- cgit v1.2.3-18-g5258