summary refs log tree commit diff
diff options
context:
space:
mode:
-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))) {