summaryrefslogtreecommitdiff
path: root/src/sysusers
diff options
context:
space:
mode:
Diffstat (limited to 'src/sysusers')
-rw-r--r--src/sysusers/sysusers.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/sysusers/sysusers.c b/src/sysusers/sysusers.c
index 1765f31a3a..40a669725e 100644
--- a/src/sysusers/sysusers.c
+++ b/src/sysusers/sysusers.c
@@ -24,6 +24,7 @@
#include <grp.h>
#include <shadow.h>
#include <getopt.h>
+#include <utmp.h>
#include "util.h"
#include "hashmap.h"
@@ -1095,6 +1096,9 @@ static bool valid_user_group_name(const char *u) {
if ((size_t) (i-u) > (size_t) sz)
return false;
+ if ((size_t) (i-u) > UT_NAMESIZE - 1)
+ return false;
+
return true;
}