Module Name:    src
Committed By:   martin
Date:           Mon Nov 12 08:46:54 UTC 2018

Modified Files:
        src/bin/sh [netbsd-8]: parser.c

Log Message:
Pull up following revision(s) (requested by kre in ticket #1086):

        bin/sh/parser.c: revision 1.152

PR bin/53712

Avoid crash from redirect on null compound command.


To generate a diff of this commit:
cvs rdiff -u -r1.132.2.6 -r1.132.2.7 src/bin/sh/parser.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/bin/sh/parser.c
diff -u src/bin/sh/parser.c:1.132.2.6 src/bin/sh/parser.c:1.132.2.7
--- src/bin/sh/parser.c:1.132.2.6	Mon Sep 10 15:45:11 2018
+++ src/bin/sh/parser.c	Mon Nov 12 08:46:54 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: parser.c,v 1.132.2.6 2018/09/10 15:45:11 martin Exp $	*/
+/*	$NetBSD: parser.c,v 1.132.2.7 2018/11/12 08:46:54 martin 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.132.2.6 2018/09/10 15:45:11 martin Exp $");
+__RCSID("$NetBSD: parser.c,v 1.132.2.7 2018/11/12 08:46:54 martin Exp $");
 #endif
 #endif /* not lint */
 
@@ -597,7 +597,7 @@ command(void)
 	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;

Reply via email to