aboutsummaryrefslogtreecommitdiffstats
path: root/smtpd/parser.c
diff options
context:
space:
mode:
authorGilles Chehade <gilles@poolp.org>2020-01-08 16:37:29 +0100
committerGilles Chehade <gilles@poolp.org>2020-01-08 16:37:29 +0100
commit4c624cc5aed4feb2117a593c0dea0c862ac23e34 (patch)
treee2e7b538d8788b2457712845f0d530a37781b8b5 /smtpd/parser.c
parentsync (diff)
downloadOpenSMTPD-4c624cc5aed4feb2117a593c0dea0c862ac23e34.tar.xz
OpenSMTPD-4c624cc5aed4feb2117a593c0dea0c862ac23e34.zip
sync
Diffstat (limited to 'smtpd/parser.c')
-rw-r--r--smtpd/parser.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/smtpd/parser.c b/smtpd/parser.c
index df90e508..24b92094 100644
--- a/smtpd/parser.c
+++ b/smtpd/parser.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: parser.c,v 1.41 2017/07/31 16:38:33 gilles Exp $ */
+/* $OpenBSD: parser.c,v 1.42 2020/01/06 11:02:38 gilles Exp $ */
/*
* Copyright (c) 2013 Eric Faurot <eric@openbsd.org>
@@ -219,6 +219,11 @@ cmd_run(int argc, char **argv)
return (node->cmd(np, np ? param : NULL));
fail:
+ if (TAILQ_FIRST(&node->children) == NULL) {
+ fprintf(stderr, "invalid command\n");
+ return (-1);
+ }
+
fprintf(stderr, "possibilities are:\n");
TAILQ_FOREACH(tmp, &node->children, entry) {
for (j = 0; j < i; j++)