Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/bin/sh PR bin/53712



details:   https://anonhg.NetBSD.org/src/rev/44ffed2a6752
branches:  trunk
changeset: 994461:44ffed2a6752
user:      kre <kre%NetBSD.org@localhost>
date:      Fri Nov 09 02:11:04 2018 +0000

description:
PR bin/53712

Avoid crash from redirect on null compound command.

diffstat:

 bin/sh/parser.c |  6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diffs (27 lines):

diff -r 948aef3c7c50 -r 44ffed2a6752 bin/sh/parser.c
--- a/bin/sh/parser.c   Thu Nov 08 23:20:52 2018 +0000
+++ b/bin/sh/parser.c   Fri Nov 09 02:11:04 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: parser.c,v 1.151 2018/11/08 18:37:42 kre Exp $ */
+/*     $NetBSD: parser.c,v 1.152 2018/11/09 02:11:04 kre Exp $ */
 
 /*-
  * Copyright (c) 1991, 1993
@@ -37,7 +37,7 @@
 #if 0
 static char sccsid[] = "@(#)parser.c   8.7 (Berkeley) 5/16/95";
 #else
-__RCSID("$NetBSD: parser.c,v 1.151 2018/11/08 18:37:42 kre Exp $");
+__RCSID("$NetBSD: parser.c,v 1.152 2018/11/09 02:11:04 kre Exp $");
 #endif
 #endif /* not lint */
 
@@ -590,7 +590,7 @@
        tokpushback++;
        *rpp = NULL;
        if (redir) {
-               if (n1->type != NSUBSHELL) {
+               if (n1 == NULL || n1->type != NSUBSHELL) {
                        n2 = stalloc(sizeof(struct nredir));
                        n2->type = NREDIR;
                        n2->nredir.n = n1;



Home | Main Index | Thread Index | Old Index