From: Rob Landley Date: Fri, 16 Dec 2005 08:02:11 +0000 (-0000) Subject: Less would segfault if it had no tty. (Bug 600.) X-Git-Tag: 1_1_0~404 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=4b91b88fcb73e928415bda80090b98b2d3806ff1;p=oweals%2Fbusybox.git Less would segfault if it had no tty. (Bug 600.) --- diff --git a/miscutils/less.c b/miscutils/less.c index 0b0dc0c8b..19051f6f6 100644 --- a/miscutils/less.c +++ b/miscutils/less.c @@ -239,6 +239,7 @@ static void data_readlines(void) { if(inp == NULL) inp = (inp_stdin) ? bb_xfopen(CURRENT_TTY, "r") : stdin; + if(inp == NULL) bb_perror_msg_and_die("no tty"); if (flags & FLAG_N) add_linenumbers();