From 613268e5e58c9d39ea81169b5a26333aa9726ce9 Mon Sep 17 00:00:00 2001 From: op Date: Thu, 23 May 2024 17:05:45 +0000 Subject: [PATCH] catch EOFs during table_proc handshake while here also do a s/fatalx/fatal since getline() sets errno on failure. ok millert@, gilles@ --- usr.sbin/smtpd/table_proc.c | 7 ++++--- 1 file 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 @@ -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"); -- 2.20.1