fix parsing of datalines before passing them to filters, the | splitting is
authorgilles <gilles@openbsd.org>
Mon, 8 Apr 2019 07:44:45 +0000 (07:44 +0000)
committergilles <gilles@openbsd.org>
Mon, 8 Apr 2019 07:44:45 +0000 (07:44 +0000)
done a bit too early

diff from Martijn van Duren <openbsd+tech@list.imperialat.at>

usr.sbin/smtpd/lka_filter.c

index a10d9cb..8d95702 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: lka_filter.c,v 1.34 2019/01/15 04:49:50 sunil Exp $   */
+/*     $OpenBSD: lka_filter.c,v 1.35 2019/04/08 07:44:45 gilles Exp $  */
 
 /*
  * Copyright (c) 2018 Gilles Chehade <gilles@poolp.org>
@@ -458,16 +458,17 @@ lka_filter_process_response(const char *name, const char *line)
                return 0;
 
        response = ep+1;
-       if ((ep = strchr(response, '|'))) {
-               parameter = ep + 1;
-               *ep = 0;
-       }
 
        if (strcmp(kind, "filter-dataline") == 0) {
                filter_data_next(token, reqid, response);
                return 1;
        }
 
+       if ((ep = strchr(response, '|'))) {
+               parameter = ep + 1;
+               *ep = 0;
+       }
+
        if (strcmp(response, "proceed") != 0 &&
            strcmp(response, "reject") != 0 &&
            strcmp(response, "disconnect") != 0 &&