From: Alejandro Colomar Date: Sat, 13 Jul 2024 09:37:25 +0000 (+0200) Subject: lib/chkname.c: An object cannot expand further than the universe in which it resides X-Git-Tag: 4.17.0-rc1~111 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=8a93576ff9ebf803fece5422edfb5a15a2f0e1fe;p=thirdparty%2Fshadow.git 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 --- 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); }