From: Karel Zak Date: Tue, 1 Jul 2025 08:09:46 +0000 (+0200) Subject: more: Use ul_strtou16() in a robust way X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=06419fe95b06c7aa8670081a68dbe43a53bff303;p=thirdparty%2Futil-linux.git more: Use ul_strtou16() in a robust way Signed-off-by: Karel Zak --- diff --git a/text-utils/more.c b/text-utils/more.c index 51c63e924..4980aef4c 100644 --- a/text-utils/more.c +++ b/text-utils/more.c @@ -2144,8 +2144,11 @@ int main(int argc, char **argv) if (getenv("MORESECURE") || getenv("PAGERSECURE")) ctl.is_secure = 1; - if ((s = getenv("MORE_SHELL_LINES")) && isdigit_string(s)) - ul_strtou16(s, (uint16_t *) &ctl.lines_per_screen, 10); + if ((s = getenv("MORE_SHELL_LINES")) && isdigit_string(s)) { + uint16_t x = 0; + if (ul_strtou16(s, (uint16_t *) &x, 10) == 0) + ctl.lines_per_screen = x; + } if ((s = getenv("MORE")) != NULL) env_argscan(&ctl, s);