about summary refs log tree commit diff
diff options
context:
space:
mode:
authorPeter Stephenson <pws@zsh.org>2015-03-05 10:02:38 +0000
committerPeter Stephenson <pws@zsh.org>2015-03-05 10:02:38 +0000
commit506eaa0a638c72f215fb0afa0b8172a43592af5b (patch)
tree89348dcc1de1589213802306a5dc96702671193d
parent19010fafd9600fda83f7dae0bbc7fbc945204bf0 (diff)
downloadzsh-506eaa0a638c72f215fb0afa0b8172a43592af5b.tar.gz
zsh-506eaa0a638c72f215fb0afa0b8172a43592af5b.tar.xz
zsh-506eaa0a638c72f215fb0afa0b8172a43592af5b.zip
34651: Avoid core dump if no lexical token
-rw-r--r--ChangeLog2
-rw-r--r--Src/lex.c3
2 files changed, 5 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index 6e49415ba..d8b2162ac 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,7 @@
 2015-03-05  Peter Stephenson  <p.stephenson@samsung.com>
 
+	* 34651: Src/lex.c: avoid core dump if no lexical token.
+
 	* Daniel Shahaf: 34647: Completion/Zsh/Function/_add-zsh-hook:
 	new completion.
 
diff --git a/Src/lex.c b/Src/lex.c
index a07661404..494ea8870 100644
--- a/Src/lex.c
+++ b/Src/lex.c
@@ -1735,6 +1735,9 @@ checkalias(void)
 {
     Alias an;
 
+    if (!zshlextext)
+	return 0;
+
     if (!noaliases && isset(ALIASESOPT) &&
 	(!isset(POSIXALIASES) ||
 	 !reswdtab->getnode(reswdtab, zshlextext))) {