Fix $regex<n> use-after-free. Bug 2915
[exim.git] / src / src / parse.c
index 3a7a4f18a7e52f33ce4de6fad7e5b50960902087..bdba3ecd0cb0be2185485f2099de9184359d05dd 100644 (file)
@@ -2,8 +2,8 @@
 *     Exim - an Internet mail transport agent    *
 *************************************************/
 
+/* Copyright (c) The Exim Maintainers 2020 - 2022 */
 /* Copyright (c) University of Cambridge 1995 - 2018 */
-/* Copyright (c) The Exim Maintainers 2020 - 2021 */
 /* See the file NOTICE for conditions of use and distribution. */
 
 /* Functions for parsing addresses */
@@ -658,7 +658,7 @@ followed by a route-addr (more words must follow). */
 
 if (*s != '@' && *s != '<')
   {
-  if (*s == 0 || *s == ';')
+  if (!*s || *s == ';')
     {
     if (!*t) FAILED(US"empty address");
     endptr = last_comment_position;