mirror of
https://git.busybox.net/busybox
synced 2026-02-15 22:16:09 +00:00
awk: fix SEGV on read error in -f PROGFILE
function old new delta awk_main 829 843 +14 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
This commit is contained in:
parent
f4789164e0
commit
113685fbcd
1 changed files with 2 additions and 2 deletions
|
|
@ -3609,8 +3609,6 @@ static var *evaluate(node *op, var *res)
|
|||
#undef sreg
|
||||
}
|
||||
|
||||
/* -------- main & co. -------- */
|
||||
|
||||
static int awk_exit(void)
|
||||
{
|
||||
unsigned i;
|
||||
|
|
@ -3717,6 +3715,8 @@ int awk_main(int argc UNUSED_PARAM, char **argv)
|
|||
g_progname = llist_pop(&list_f);
|
||||
fd = xopen_stdin(g_progname);
|
||||
s = xmalloc_read(fd, NULL); /* it's NUL-terminated */
|
||||
if (!s)
|
||||
bb_perror_msg_and_die("read error from '%s'", g_progname);
|
||||
close(fd);
|
||||
parse_program(s);
|
||||
free(s);
|
||||
|
|
|
|||
Loading…
Reference in a new issue