sendmail: fix parsing of addresses in angle brackets
authorRaffaello D. Di Napoli <rafdev@dinapo.li>
Tue, 26 Jun 2018 23:18:02 +0000 (19:18 -0400)
committerDenys Vlasenko <vda.linux@googlemail.com>
Sun, 15 Jul 2018 12:52:21 +0000 (14:52 +0200)
Pointer e needs to be wound back in order to overwrite '>' with '\0'.
Regression introduced in 20077c1429

Signed-off-by: Raffaello D. Di Napoli <rafdev@dinapo.li>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
mailutils/sendmail.c

index 4ca91fad8e9c85975a457fed68639428c778c443..0170f28703c4f3b99032e9dbb2800f02f4c1d2cb 100644 (file)
@@ -173,7 +173,7 @@ static char *angle_address(char *str)
        char *s, *e;
 
        e = trim(str);
-       if (e != str && e[-1] == '>') {
+       if (e != str && *--e == '>') {
                s = strrchr(str, '<');
                if (s) {
                        *e = '\0';