From 8a93576ff9ebf803fece5422edfb5a15a2f0e1fe Mon Sep 17 00:00:00 2001 From: Alejandro Colomar Date: Sat, 13 Jul 2024 11:37:25 +0200 Subject: [PATCH] lib/chkname.c: An object cannot expand further than the universe in which it resides If you want a larger object, you'll have to wait at least until the universe expands so much. If an implementation doesn't recognize its own limitations, its a bug, not a feature. Closes: Cc: Tobias Stoeckmann Signed-off-by: Alejandro Colomar --- lib/chkname.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/chkname.c b/lib/chkname.c index 995562fa1..bc631f2e1 100644 --- a/lib/chkname.c +++ b/lib/chkname.c @@ -24,6 +24,8 @@ #include #include #include +#include +#include #include #include "defines.h" @@ -43,7 +45,7 @@ login_name_max_size(void) if (conf == -1 && errno != 0) return LOGIN_NAME_MAX; - return conf; + return MIN(conf, PTRDIFF_MAX); } -- 2.47.3