diff options
author | Omar Polo <op@cvs.openbsd.org> | 2024-05-23 17:05:46 +0000 |
---|---|---|
committer | Omar Polo <op@cvs.openbsd.org> | 2024-05-23 17:05:46 +0000 |
commit | 6112e78ca143474c6c82cc57f4deb842b720429e (patch) | |
tree | 3c96d10c680984015df3a84fcca2af7b0aebd135 /usr.sbin/smtpd | |
parent | 787ea8622528e07bcbce6922c0c75319e9bad38a (diff) |
catch EOFs during table_proc handshake
while here also do a s/fatalx/fatal since getline() sets errno on
failure.
ok millert@, gilles@
Diffstat (limited to 'usr.sbin/smtpd')
-rw-r--r-- | usr.sbin/smtpd/table_proc.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/usr.sbin/smtpd/table_proc.c b/usr.sbin/smtpd/table_proc.c index 07cabf073bc..f21fd2b5095 100644 --- a/usr.sbin/smtpd/table_proc.c +++ b/usr.sbin/smtpd/table_proc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: table_proc.c,v 1.20 2024/05/22 08:41:02 op Exp $ */ +/* $OpenBSD: table_proc.c,v 1.21 2024/05/23 17:05:45 op Exp $ */ /* * Copyright (c) 2024 Omar Polo <op@openbsd.org> @@ -166,8 +166,9 @@ table_proc_open(struct table *table) } if (ferror(priv->in)) - fatalx("table-proc: getline"); - + fatal("table-proc: getline"); + if (feof(priv->in)) + fatalx("table-proc: unexpected EOF during handshake"); if (services == 0) fatalx("table-proc: no services registered"); |